/** * Constructor for the XttRefObj object * * @param fullname Description of the Parameter * @param en Description of the Parameter * @param cid Description of the Parameter * @param treeNode Description of the Parameter * @param index Description of the Parameter */ public XttRefObj( String fullname, JopEngine en, int cid, /*String showableClassName,*/ DefaultMutableTreeNode treeNode, int index) { this.index = index; this.fullname = fullname; XttRefObj.en = en; this.cid = cid; // this.showableClassName = showableClassName; if (index < 0) { Logg.logg("Fel vid försök att debugga", 0); return; } CdhrObjAttr oa = AttrObj[index]; Logg.logg("XttRefObj konstruktor", 6); if (oa != null) { objAttribute = new XttObjAttr(oa); objAttribute.treeNode = treeNode; objAttribute.showName = false; en.add(this); } else { Logg.logg("Kan ej debugga " + fullname + " cid: " + cid + " på index " + index, 0); } }
public void actionPerformed(ActionEvent e) { boolean engine_found = false; Container parent = getParent(); while (parent != null) { if (parent instanceof JopFrame) { en = ((JopFrame) parent).engine; if (!en.isReady()) break; en.add(this); root = parent; session = ((JopFrame) root).session; engine_found = true; break; } parent = parent.getParent(); } if (!engine_found) { parent = getParent(); while (parent != null) { if (parent instanceof JopApplet) { en = ((JopApplet) parent).engine; if (!en.isReady()) break; en.add(this); root = parent; session = ((JopApplet) root).session; engine_found = true; break; } parent = parent.getParent(); } } if (engine_found) { timer.stop(); timer = null; if (en.gdh.isAuthorized(access)) { this.addMouseListener( new MouseAdapter() { public void mouseClicked(MouseEvent e) { PwrtStatus sts; if (confirm) { JopConfirmDialog.open(component, confirmText); } else if (clickAction == Jop.BUTTON_ACTION_SET) { sts = en.gdh.setObjectInfo(pwrAttribute, true); if (sts.evenSts()) System.out.println("setObjectInfoError " + sts); } else if (clickAction == Jop.BUTTON_ACTION_RESET) { sts = en.gdh.setObjectInfo(pwrAttribute, false); if (sts.evenSts()) System.out.println("setObjectInfoError " + sts); } else if (clickAction == Jop.BUTTON_ACTION_TOGGLE) { sts = en.gdh.toggleObjectInfo(pwrAttribute); if (sts.evenSts()) System.out.println("setObjectInfoError " + sts); } else if (clickAction == Jop.BUTTON_ACTION_COMMAND) { Jop.executeCommand(session, command); } } public void mousePressed(MouseEvent e) { colorInverse = 1; repaint(); } public void mouseReleased(MouseEvent e) { colorInverse = 0; repaint(); } }); } } }