bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
public static RemoteException mapSystemException(SystemException ex) { if(delegate != null) return delegate.mapSystemException(ex); else return null; }
public static RemoteException mapSystemException(SystemException ex) { if(delegate != null) return delegate.mapSystemException(ex); else return null; }
3,202
public static Object readAny(InputStream in) { if(delegate != null) return delegate.readAny(in); else return null; }
public static java.lang.Object readAny(InputStream input) { if(delegate != null) return delegate.readAny(in); else return null; }
3,203
public static Object readAny(InputStream in) { if(delegate != null) return delegate.readAny(in); else return null; }
public static Object readAny(InputStream in) { if(delegate != null) return delegate.readAny(in); else return null; }
3,204
public static void registerTarget(Tie tie, Remote target) { if(delegate != null) delegate.registerTarget(tie, target); }
public static void registerTarget(Tie tie, Remote target) { delegate.registerTarget(tie, target); }
3,205
public static void unexportObject(Remote target) { if(delegate != null) delegate.unexportObject(target); }
public static void unexportObject(Remote target) { delegate.unexportObject(target); }
3,206
public static RemoteException wrapException(Throwable orig) { if(delegate != null) return delegate.wrapException(orig); else return null; }
public static RemoteException wrapException(Throwable exception) { if(delegate != null) return delegate.wrapException(orig); else return null; }
3,207
public static RemoteException wrapException(Throwable orig) { if(delegate != null) return delegate.wrapException(orig); else return null; }
public static RemoteException wrapException(Throwable orig) { if(delegate != null) return delegate.wrapException(orig); else return null; }
3,208
public static void writeAbstractObject(OutputStream out, Object obj) { if(delegate != null) delegate.writeAbstractObject(out, obj); }
public static void writeAbstractObject(OutputStream output, java.lang.Object object) { if(delegate != null) delegate.writeAbstractObject(out, obj); }
3,209
public static void writeAbstractObject(OutputStream out, Object obj) { if(delegate != null) delegate.writeAbstractObject(out, obj); }
public static void writeAbstractObject(OutputStream out, Object obj) { if(delegate != null) delegate.writeAbstractObject(out, obj); }
3,210
public static void writeAny(OutputStream out, Object obj) { if(delegate != null) delegate.writeAny(out, obj); }
public static void writeAny(OutputStream output, java.lang.Object object) { if(delegate != null) delegate.writeAny(out, obj); }
3,211
public static void writeAny(OutputStream out, Object obj) { if(delegate != null) delegate.writeAny(out, obj); }
public static void writeAny(OutputStream out, Object obj) { if(delegate != null) delegate.writeAny(out, obj); }
3,212
public static void writeRemoteObject(OutputStream out, Object obj) { if(delegate != null) delegate.writeRemoteObject(out, obj); }
public static void writeRemoteObject(OutputStream output, java.lang.Object object) { if(delegate != null) delegate.writeRemoteObject(out, obj); }
3,213
public static void writeRemoteObject(OutputStream out, Object obj) { if(delegate != null) delegate.writeRemoteObject(out, obj); }
public static void writeRemoteObject(OutputStream out, Object obj) { if(delegate != null) delegate.writeRemoteObject(out, obj); }
3,214
Object copyObject(Object obj, javax.rmi.ORB orb) throws RemoteException;
Object copyObject(Object obj, ORB orb) throws RemoteException;
3,215
Object[] copyObjects(Object obj[], javax.rmi.ORB orb) throws RemoteException;
Object[] copyObjects(Object[] obj, ORB orb) throws RemoteException;
3,216
Object readAny(InputStream in);
Object readAny(InputStream input);
3,217
void writeAbstractObject(OutputStream out, Object obj);
void writeAbstractObject(OutputStream output, Object object);
3,218
void writeAny(OutputStream out, Object obj);
void writeAny(OutputStream output, Object object);
3,219
void writeRemoteObject(OutputStream out, Object obj);
void writeRemoteObject(OutputStream output, Object obj);
3,220
public void transform(AffineTransform Tx) { transform.concatenate(Tx); }
public void transform(AffineTransform Tx) { transform.concatenate(Tx); }
3,221
protected void decrLayer(Integer layer) { int sz = 0; if (layers.containsKey (layer)) sz = ((Integer)(layers.get (layer))).intValue () - 1; layers.put (layer, new Integer(sz)); }
private void decrLayer(Integer layer) { int sz = 0; if (layers.containsKey (layer)) sz = ((Integer)(layers.get (layer))).intValue () - 1; layers.put (layer, new Integer(sz)); }
3,222
protected void incrLayer(Integer layer) { int sz = 1; if (layers.containsKey (layer)) sz += ((Integer)(layers.get (layer))).intValue (); layers.put (layer, new Integer(sz)); }
private void incrLayer(Integer layer) { int sz = 1; if (layers.containsKey (layer)) sz += ((Integer)(layers.get (layer))).intValue (); layers.put (layer, new Integer(sz)); }
3,223
protected int[] layerToRange (Integer layer) { int[] ret = new int[2]; ret[1] = getComponents ().length; Iterator i = layers.entrySet ().iterator (); while (i.hasNext()) { Map.Entry pair = (Map.Entry) i.next(); Integer layerNum = (Integer) pair.getKey (); Integer layerSz = (Integer) pair.getValue (); if (layerNum.intValue() == layer.intValue()) { ret[0] = ret[1] - layerSz.intValue (); return ret; } else { ret[1] -= layerSz.intValue (); } } // should have found the layer during iteration throw new IllegalArgumentException (); }
private int[] layerToRange (Integer layer) { int[] ret = new int[2]; ret[1] = getComponents ().length; Iterator i = layers.entrySet ().iterator (); while (i.hasNext()) { Map.Entry pair = (Map.Entry) i.next(); Integer layerNum = (Integer) pair.getKey (); Integer layerSz = (Integer) pair.getValue (); if (layerNum.intValue() == layer.intValue()) { ret[0] = ret[1] - layerSz.intValue (); return ret; } else { ret[1] -= layerSz.intValue (); } } // should have found the layer during iteration throw new IllegalArgumentException (); }
3,224
public Dimension minimumLayoutSize(Container parent) { // Sun's implementation simply throws a ClassCastException if // parent is no JScrollPane, so do we. JScrollPane sc = (JScrollPane) parent; Dimension viewportSize = viewport.getMinimumSize(); int width = viewportSize.width; int height = viewportSize.height; if (hsb != null && hsb.isVisible()) height += hsb.getMinimumSize().height; if (vsb != null && vsb.isVisible()) width += vsb.getMinimumSize().width; if (rowHead != null && rowHead.isVisible()) width += rowHead.getMinimumSize().width; if (colHead != null && colHead.isVisible()) height += colHead.getMinimumSize().height; Insets i = sc.getInsets(); return new Dimension(width + i.left + i.right, height + i.top + i.bottom); }
public Dimension minimumLayoutSize(Container parent) { // Sun's implementation simply throws a ClassCastException if // parent is no JScrollPane, so do we. JScrollPane sc = (JScrollPane) parent; Dimension viewportSize = viewport.getMinimumSize(); int width = viewportSize.width; int height = viewportSize.height; if (hsb != null && hsb.isVisible()) height += hsb.getMinimumSize().height; if (vsb != null && vsb.isVisible()) width += vsb.getMinimumSize().width; if (rowHead != null && rowHead.isVisible()) width += rowHead.getMinimumSize().width; if (colHead != null && colHead.isVisible()) height += colHead.getMinimumSize().height; Insets i = sc.getInsets(); return new Dimension(width + i.left + i.right, height + i.top + i.bottom); }
3,225
public Dimension minimumLayoutSize(Container parent) { // Sun's implementation simply throws a ClassCastException if // parent is no JScrollPane, so do we. JScrollPane sc = (JScrollPane) parent; Dimension viewportSize = viewport.getMinimumSize(); int width = viewportSize.width; int height = viewportSize.height; if (hsb != null && hsb.isVisible()) height += hsb.getMinimumSize().height; if (vsb != null && vsb.isVisible()) width += vsb.getMinimumSize().width; if (rowHead != null && rowHead.isVisible()) width += rowHead.getMinimumSize().width; if (colHead != null && colHead.isVisible()) height += colHead.getMinimumSize().height; Insets i = sc.getInsets(); return new Dimension(width + i.left + i.right, height + i.top + i.bottom); }
public Dimension minimumLayoutSize(Container parent) { // Sun's implementation simply throws a ClassCastException if // parent is no JScrollPane, so do we. JScrollPane sc = (JScrollPane) parent; Dimension viewportSize = viewport.getMinimumSize(); int width = viewportSize.width; int height = viewportSize.height; if (hsb != null && hsb.isVisible()) height += hsb.getMinimumSize().height; if (vsb != null && vsb.isVisible()) width += vsb.getMinimumSize().width; if (rowHead != null && rowHead.isVisible()) width += rowHead.getMinimumSize().width; if (colHead != null && colHead.isVisible()) height += colHead.getMinimumSize().height; Insets i = sc.getInsets(); return new Dimension(width + i.left + i.right, height + i.top + i.bottom); }
3,226
public boolean canDrawRubberBand(RubberBand b) { // before we get the row col we first have to translate the x,y point // back to screen coordinates because we are translating the starting // point to the 5250 screen coordinates return !screen.isKeyboardLocked() && (screen.isWithinScreenArea(b.getStartPoint().x,b.getStartPoint().y)); }
public boolean canDrawRubberBand(RubberBand b) { // before we get the row col we first have to translate the x,y point // back to screen coordinates because we are translating the starting // point to the 5250 screen coordinates return screen.isWithinScreenArea(b.getStartPoint().x,b.getStartPoint().y); }
3,227
public void doKeyBoundArea(KeyEvent ke,String last) { Point p = new Point(); if (!rubberband.isAreaSelected()) { if (last.equals("[markleft]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol()-1, p); if (last.equals("[markright]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol()-2, p); if (last.equals("[markup]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol() - 1, p); if (last.equals("[markdown]")) screen.getPointFromRowCol(screen.getCurrentRow()-2, screen.getCurrentCol() - 1, p); MouseEvent me = new MouseEvent(this, MouseEvent.MOUSE_PRESSED, System.currentTimeMillis(), MouseEvent.BUTTON1_MASK, p.x,p.y, 1,false); dispatchEvent(me); } screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol() - 1, p); rubberband.getCanvas().translateEnd(p); MouseEvent me = new MouseEvent(this, MouseEvent.MOUSE_DRAGGED, System.currentTimeMillis(), MouseEvent.BUTTON1_MASK, p.x,p.y, 1,false); dispatchEvent(me); }
public void doKeyBoundArea(KeyEvent ke,String last) { Point p = new Point(); if (!rubberband.isAreaSelected()) { if (last.equals("[markleft]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol() + 1, p); if (last.equals("[markright]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol()-2, p); if (last.equals("[markup]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol() - 1, p); if (last.equals("[markdown]")) screen.getPointFromRowCol(screen.getCurrentRow()-2, screen.getCurrentCol() - 1, p); MouseEvent me = new MouseEvent(this, MouseEvent.MOUSE_PRESSED, System.currentTimeMillis(), MouseEvent.BUTTON1_MASK, p.x,p.y, 1,false); dispatchEvent(me); } screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol() - 1, p); rubberband.getCanvas().translateEnd(p); MouseEvent me = new MouseEvent(this, MouseEvent.MOUSE_DRAGGED, System.currentTimeMillis(), MouseEvent.BUTTON1_MASK, p.x,p.y, 1,false); dispatchEvent(me); }
3,228
public void doKeyBoundArea(KeyEvent ke,String last) { Point p = new Point(); if (!rubberband.isAreaSelected()) { if (last.equals("[markleft]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol()-1, p); if (last.equals("[markright]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol()-2, p); if (last.equals("[markup]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol() - 1, p); if (last.equals("[markdown]")) screen.getPointFromRowCol(screen.getCurrentRow()-2, screen.getCurrentCol() - 1, p); MouseEvent me = new MouseEvent(this, MouseEvent.MOUSE_PRESSED, System.currentTimeMillis(), MouseEvent.BUTTON1_MASK, p.x,p.y, 1,false); dispatchEvent(me); } screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol() - 1, p); rubberband.getCanvas().translateEnd(p); MouseEvent me = new MouseEvent(this, MouseEvent.MOUSE_DRAGGED, System.currentTimeMillis(), MouseEvent.BUTTON1_MASK, p.x,p.y, 1,false); dispatchEvent(me); }
public void doKeyBoundArea(KeyEvent ke,String last) { Point p = new Point(); if (!rubberband.isAreaSelected()) { if (last.equals("[markleft]")) screen.getPointFromRowCol(screen.getCurrentRow() + 1, screen.getCurrentCol()-1, p); if (last.equals("[markright]")) screen.getPointFromRowCol(screen.getCurrentRow() + 1, screen.getCurrentCol()-2, p); if (last.equals("[markup]")) screen.getPointFromRowCol(screen.getCurrentRow() + 1, screen.getCurrentCol() - 1, p); if (last.equals("[markdown]")) screen.getPointFromRowCol(screen.getCurrentRow()-2, screen.getCurrentCol() - 1, p); MouseEvent me = new MouseEvent(this, MouseEvent.MOUSE_PRESSED, System.currentTimeMillis(), MouseEvent.BUTTON1_MASK, p.x,p.y, 1,false); dispatchEvent(me); } screen.getPointFromRowCol(screen.getCurrentRow() + 1, screen.getCurrentCol() - 1, p); rubberband.getCanvas().translateEnd(p); MouseEvent me = new MouseEvent(this, MouseEvent.MOUSE_DRAGGED, System.currentTimeMillis(), MouseEvent.BUTTON1_MASK, p.x,p.y, 1,false); dispatchEvent(me); }
3,229
public void doKeyBoundArea(KeyEvent ke,String last) { Point p = new Point(); if (!rubberband.isAreaSelected()) { if (last.equals("[markleft]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol()-1, p); if (last.equals("[markright]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol()-2, p); if (last.equals("[markup]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol() - 1, p); if (last.equals("[markdown]")) screen.getPointFromRowCol(screen.getCurrentRow()-2, screen.getCurrentCol() - 1, p); MouseEvent me = new MouseEvent(this, MouseEvent.MOUSE_PRESSED, System.currentTimeMillis(), MouseEvent.BUTTON1_MASK, p.x,p.y, 1,false); dispatchEvent(me); } screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol() - 1, p); rubberband.getCanvas().translateEnd(p); MouseEvent me = new MouseEvent(this, MouseEvent.MOUSE_DRAGGED, System.currentTimeMillis(), MouseEvent.BUTTON1_MASK, p.x,p.y, 1,false); dispatchEvent(me); }
public void doKeyBoundArea(KeyEvent ke,String last) { Point p = new Point(); if (!rubberband.isAreaSelected()) { if (last.equals("[markleft]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol()-1, p); if (last.equals("[markright]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol()-2, p); if (last.equals("[markup]")) screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol() - 1, p); if (last.equals("[markdown]")) screen.getPointFromRowCol(screen.getCurrentRow()-2, screen.getCurrentCol() - 1, p); MouseEvent me = new MouseEvent(this, MouseEvent.MOUSE_PRESSED, System.currentTimeMillis(), MouseEvent.BUTTON1_MASK, p.x,p.y, 1,false); dispatchEvent(me); } screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol() - 1, p); MouseEvent me = new MouseEvent(this, MouseEvent.MOUSE_DRAGGED, System.currentTimeMillis(), MouseEvent.BUTTON1_MASK, p.x,p.y, 1,false); dispatchEvent(me); }
3,230
private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_COPY); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { rubberband.getBoundingArea(workR); // get the width and height int ePos = screen.getRowColFromPoint(workR.width + 1 , workR.height + 1 ); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + screen.getCol(ePos)); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + screen.getRow(ePos)); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (keyHandler.isRecording()) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export")); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) { public void actionPerformed(ActionEvent e) { doMeSpool(); getFocusForMe(); } }; xtfrMenu.add(action); popup.add(xtfrMenu); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); GUIGraphicsUtils.positionPopup(me.getComponent(),popup, me.getX(),me.getY()); }
private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getPosFromView(me.getX(),me.getY()); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_COPY); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { rubberband.getBoundingArea(workR); // get the width and height int ePos = screen.getRowColFromPoint(workR.width + 1 , workR.height + 1 ); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + screen.getCol(ePos)); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + screen.getRow(ePos)); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (keyHandler.isRecording()) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export")); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) { public void actionPerformed(ActionEvent e) { doMeSpool(); getFocusForMe(); } }; xtfrMenu.add(action); popup.add(xtfrMenu); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); GUIGraphicsUtils.positionPopup(me.getComponent(),popup, me.getX(),me.getY()); }
3,231
private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_COPY); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { rubberband.getBoundingArea(workR); // get the width and height int ePos = screen.getRowColFromPoint(workR.width + 1 , workR.height + 1 ); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + screen.getCol(ePos)); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + screen.getRow(ePos)); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (keyHandler.isRecording()) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export")); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) { public void actionPerformed(ActionEvent e) { doMeSpool(); getFocusForMe(); } }; xtfrMenu.add(action); popup.add(xtfrMenu); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); GUIGraphicsUtils.positionPopup(me.getComponent(),popup, me.getX(),me.getY()); }
private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.copyMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_COPY); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.copyMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { rubberband.getBoundingArea(workR); // get the width and height int ePos = screen.getRowColFromPoint(workR.width + 1 , workR.height + 1 ); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + screen.getCol(ePos)); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + screen.getRow(ePos)); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (keyHandler.isRecording()) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export")); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) { public void actionPerformed(ActionEvent e) { doMeSpool(); getFocusForMe(); } }; xtfrMenu.add(action); popup.add(xtfrMenu); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); GUIGraphicsUtils.positionPopup(me.getComponent(),popup, me.getX(),me.getY()); }
3,232
private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_COPY); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { rubberband.getBoundingArea(workR); // get the width and height int ePos = screen.getRowColFromPoint(workR.width + 1 , workR.height + 1 ); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + screen.getCol(ePos)); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + screen.getRow(ePos)); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (keyHandler.isRecording()) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export")); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) { public void actionPerformed(ActionEvent e) { doMeSpool(); getFocusForMe(); } }; xtfrMenu.add(action); popup.add(xtfrMenu); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); GUIGraphicsUtils.positionPopup(me.getComponent(),popup, me.getX(),me.getY()); }
private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_COPY); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { rubberband.getBoundingArea(workR); // get the width and height int ePos = screen.getRowColFromPoint(workR.width + 1 , workR.height + 1 ); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + screen.getCol(ePos)); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + screen.getRow(ePos)); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (keyHandler.isRecording()) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export")); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) { public void actionPerformed(ActionEvent e) { doMeSpool(); getFocusForMe(); } }; xtfrMenu.add(action); popup.add(xtfrMenu); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); GUIGraphicsUtils.positionPopup(me.getComponent(),popup, me.getX(),me.getY()); }
3,233
private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_COPY); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { rubberband.getBoundingArea(workR); // get the width and height int ePos = screen.getRowColFromPoint(workR.width + 1 , workR.height + 1 ); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + screen.getCol(ePos)); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + screen.getRow(ePos)); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (keyHandler.isRecording()) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export")); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) { public void actionPerformed(ActionEvent e) { doMeSpool(); getFocusForMe(); } }; xtfrMenu.add(action); popup.add(xtfrMenu); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); GUIGraphicsUtils.positionPopup(me.getComponent(),popup, me.getX(),me.getY()); }
private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_COPY); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { rubberband.getBoundingArea(workR); // get the width and height int ePos = screen.getRowColFromPoint(workR.width + 1 , workR.height + 1 ); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + workR.width); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + screen.getRow(ePos)); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (keyHandler.isRecording()) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export")); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) { public void actionPerformed(ActionEvent e) { doMeSpool(); getFocusForMe(); } }; xtfrMenu.add(action); popup.add(xtfrMenu); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); GUIGraphicsUtils.positionPopup(me.getComponent(),popup, me.getX(),me.getY()); }
3,234
private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_COPY); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { rubberband.getBoundingArea(workR); // get the width and height int ePos = screen.getRowColFromPoint(workR.width + 1 , workR.height + 1 ); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + screen.getCol(ePos)); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + screen.getRow(ePos)); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (keyHandler.isRecording()) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export")); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) { public void actionPerformed(ActionEvent e) { doMeSpool(); getFocusForMe(); } }; xtfrMenu.add(action); popup.add(xtfrMenu); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); GUIGraphicsUtils.positionPopup(me.getComponent(),popup, me.getX(),me.getY()); }
private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_COPY); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { rubberband.getBoundingArea(workR); // get the width and height int ePos = screen.getRowColFromPoint(workR.width + 1 , workR.height + 1 ); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + screen.getCol(ePos)); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + workR.height); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (keyHandler.isRecording()) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export")); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) { public void actionPerformed(ActionEvent e) { doMeSpool(); getFocusForMe(); } }; xtfrMenu.add(action); popup.add(xtfrMenu); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); GUIGraphicsUtils.positionPopup(me.getComponent(),popup, me.getX(),me.getY()); }
3,235
public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); }
public void actionPerformed(ActionEvent e) { screen.copyMe(); getFocusForMe(); }
3,236
public void read_value(org.omg.CORBA.portable.InputStream input, TypeCode a_type ) throws MARSHAL { try { int kind = a_type.kind().value(); // Fixed needs special handling. if (kind == TCKind._tk_fixed) { BigDecimal dec = BigDecimalHelper.read(input, a_type.fixed_scale()); has = new FixedHolder(dec); } else { has = holderFactory.createHolder(a_type); if (has == null) throw new NO_IMPLEMENT("Not implemented for " + typeNamer.nameIt(a_type) ); } type(a_type); has._read(input); } catch (BadKind ex) { throw new MARSHAL("Bad kind: " + ex.getMessage()); } catch (IOException ex) { throw new MARSHAL("IO exception: " + ex.getMessage()); } }
public void read_value(org.omg.CORBA.portable.InputStream input, TypeCode a_type ) throws MARSHAL { try { int kind = a_type.kind().value(); // Fixed needs special handling. if (kind == TCKind._tk_fixed) { BigDecimal dec = BigDecimalHelper.read(input, a_type.fixed_scale()); has = new FixedHolder(dec); } else { has = holderFactory.createHolder(a_type); if (has == null) throw new NO_IMPLEMENT("Not implemented for " + typeNamer.nameIt(a_type) ); } type(a_type); has._read(input); } catch (BadKind ex) { throw new MARSHAL("Bad kind: " + ex.getMessage()); } catch (IOException ex) { throw new MARSHAL("IO exception: " + ex.getMessage()); } }
3,238
public void setRoot(TreeNode root) { // Sanity Check if (root == null) { throw new IllegalArgumentException("null root"); } // Set new root this.root = root; }
public void setRoot(TreeNode root) { // Sanity Check if (root == null) { throw new IllegalArgumentException("null root"); } // Set new root this.root = root; }
3,241
public void setLeadSelectionIndex(int leadIndex) { int oldLeadIndex = leadSelectionIndex; if (setLeadCalledFromAdd == false) oldSel = sel.clone(); leadSelectionIndex = leadIndex; if (anchorSelectionIndex == -1) return; int R1 = Math.min(anchorSelectionIndex, oldLeadIndex); int R2 = Math.max(anchorSelectionIndex, oldLeadIndex); int S1 = Math.min(anchorSelectionIndex, leadIndex); int S2 = Math.max(anchorSelectionIndex, leadIndex); int lo = Math.min(R1, S1); int hi = Math.max(R2, S2); BitSet oldRange = sel.get(lo, hi+1); if (isSelectedIndex(anchorSelectionIndex)) { sel.clear(R1, R2+1); sel.set(S1, S2+1); } else { sel.set(R1, R2+1); sel.clear(S1, S2+1); } BitSet newRange = sel.get(lo, hi+1); newRange.xor(oldRange); int beg = sel.nextSetBit(0), end = -1; for(int i=beg; i >= 0; i=sel.nextSetBit(i+1)) end = i; if (sel.equals(oldSel) == false) fireValueChanged(beg, end, valueIsAdjusting); }
public void setLeadSelectionIndex(int leadIndex) { int oldLeadIndex = leadSelectionIndex; if (setLeadCalledFromAdd == false) oldSel = sel.clone(); leadSelectionIndex = leadIndex; if (anchorSelectionIndex == -1) return; int R1 = Math.min(anchorSelectionIndex, oldLeadIndex); int R2 = Math.max(anchorSelectionIndex, oldLeadIndex); int S1 = Math.min(anchorSelectionIndex, leadIndex); int S2 = Math.max(anchorSelectionIndex, leadIndex); int lo = Math.min(R1, S1); int hi = Math.max(R2, S2); if (isSelectedIndex(anchorSelectionIndex)) { sel.clear(R1, R2+1); sel.set(S1, S2+1); } else { sel.set(R1, R2+1); sel.clear(S1, S2+1); } BitSet newRange = sel.get(lo, hi+1); newRange.xor(oldRange); int beg = sel.nextSetBit(0), end = -1; for(int i=beg; i >= 0; i=sel.nextSetBit(i+1)) end = i; if (sel.equals(oldSel) == false) fireValueChanged(beg, end, valueIsAdjusting); }
3,243
public void setLeadSelectionIndex(int leadIndex) { int oldLeadIndex = leadSelectionIndex; if (setLeadCalledFromAdd == false) oldSel = sel.clone(); leadSelectionIndex = leadIndex; if (anchorSelectionIndex == -1) return; int R1 = Math.min(anchorSelectionIndex, oldLeadIndex); int R2 = Math.max(anchorSelectionIndex, oldLeadIndex); int S1 = Math.min(anchorSelectionIndex, leadIndex); int S2 = Math.max(anchorSelectionIndex, leadIndex); int lo = Math.min(R1, S1); int hi = Math.max(R2, S2); BitSet oldRange = sel.get(lo, hi+1); if (isSelectedIndex(anchorSelectionIndex)) { sel.clear(R1, R2+1); sel.set(S1, S2+1); } else { sel.set(R1, R2+1); sel.clear(S1, S2+1); } BitSet newRange = sel.get(lo, hi+1); newRange.xor(oldRange); int beg = sel.nextSetBit(0), end = -1; for(int i=beg; i >= 0; i=sel.nextSetBit(i+1)) end = i; if (sel.equals(oldSel) == false) fireValueChanged(beg, end, valueIsAdjusting); }
public void setLeadSelectionIndex(int leadIndex) { int oldLeadIndex = leadSelectionIndex; if (setLeadCalledFromAdd == false) oldSel = sel.clone(); leadSelectionIndex = leadIndex; if (anchorSelectionIndex == -1) return; int R1 = Math.min(anchorSelectionIndex, oldLeadIndex); int R2 = Math.max(anchorSelectionIndex, oldLeadIndex); int S1 = Math.min(anchorSelectionIndex, leadIndex); int S2 = Math.max(anchorSelectionIndex, leadIndex); int lo = Math.min(R1, S1); int hi = Math.max(R2, S2); BitSet oldRange = sel.get(lo, hi+1); if (isSelectedIndex(anchorSelectionIndex)) { sel.clear(R1, R2+1); sel.set(S1, S2+1); } else { sel.set(R1, R2+1); sel.clear(S1, S2+1); } BitSet newRange = sel.get(lo, hi+1); newRange.xor(oldRange); int beg = sel.nextSetBit(0), end = -1; for(int i=beg; i >= 0; i=sel.nextSetBit(i+1)) end = i; if (sel.equals(oldSel) == false) fireValueChanged(beg, end, valueIsAdjusting); }
3,244
protected Graphics getComponentGraphics(Graphics g) { if (g instanceof Graphics2D) { g.setFont (this.getFont()); g.setColor (this.getForeground()); return g; } else { Graphics g2 = g.create (); g2.setFont (this.getFont()); g2.setColor (this.getForeground()); return g2; } }
protected Graphics getComponentGraphics(Graphics g) { if (g instanceof Graphics2D) { g.setFont (this.getFont()); g.setColor (this.getForeground()); return g; } else { Graphics g2 = g.create (); g2.setFont (this.getFont()); g2.setColor (this.getForeground()); return g2; } }
3,245
protected Graphics getComponentGraphics(Graphics g) { if (g instanceof Graphics2D) { g.setFont (this.getFont()); g.setColor (this.getForeground()); return g; } else { Graphics g2 = g.create (); g2.setFont (this.getFont()); g2.setColor (this.getForeground()); return g2; } }
protected Graphics getComponentGraphics(Graphics g) { if (g instanceof Graphics2D) { g.setFont (this.getFont()); g.setColor (this.getForeground()); return g; } else { Graphics g2 = g.create (); g2.setFont (this.getFont()); g2.setColor (this.getForeground()); return g2; } }
3,246
protected void paintComponent(Graphics g) { if (ui != null) ui.update(g, this); }
protected void paintComponent(Graphics g) { if (ui != null) { Graphics g2 = g; if (!(g instanceof Graphics2D)) g2 = g.create(); ui.update(getComponentGraphics(g2), this); if (!(g instanceof Graphics2D)) g2.dispose(); } }
3,247
public void setBackground(Color bg) { super.setBackground(bg); revalidate(); repaint(); }
public void setBackground(Color bg) { super.setBackground(bg); revalidate(); repaint(); }
3,248
public void setBorder(Border newBorder) { Border oldBorder = border; border = newBorder; firePropertyChange("border", oldBorder, newBorder); revalidate(); repaint(); }
public void setBorder(Border newBorder) { Border oldBorder = border; border = newBorder; firePropertyChange("border", oldBorder, newBorder); revalidate(); repaint(); }
3,249
public void setEnabled(boolean enable) { boolean oldEnabled = isEnabled(); super.setEnabled(enable); firePropertyChange("enabeld", oldEnabled, enable); revalidate(); repaint(); }
public void setEnabled(boolean enable) { boolean oldEnabled = isEnabled(); super.setEnabled(enable); firePropertyChange("enabeld", oldEnabled, enable); revalidate(); repaint(); }
3,250
public void setFont(Font f) { super.setFont(f); revalidate(); repaint(); }
public void setFont(Font f) { super.setFont(f); revalidate(); repaint(); }
3,251
public void setForeground(Color fg) { super.setForeground(fg); revalidate(); repaint(); }
public void setForeground(Color fg) { super.setForeground(fg); revalidate(); repaint(); }
3,252
public void setMaximumSize(Dimension max) { Dimension oldMaximumSize = maximumSize; maximumSize = max; firePropertyChange("maximumSize", oldMaximumSize, maximumSize); revalidate(); repaint(); }
public void setMaximumSize(Dimension max) { Dimension oldMaximumSize = maximumSize; maximumSize = max; firePropertyChange("maximumSize", oldMaximumSize, maximumSize); revalidate(); repaint(); }
3,253
public void setMinimumSize(Dimension min) { Dimension oldMinimumSize = minimumSize; minimumSize = min; firePropertyChange("minimumSize", oldMinimumSize, minimumSize); revalidate(); repaint(); }
public void setMinimumSize(Dimension min) { Dimension oldMinimumSize = minimumSize; minimumSize = min; firePropertyChange("minimumSize", oldMinimumSize, minimumSize); revalidate(); repaint(); }
3,254
protected void setUI(ComponentUI newUI) { if (ui != null) ui.uninstallUI(this); ComponentUI oldUI = ui; ui = newUI; if (ui != null) ui.installUI(this); firePropertyChange("UI", oldUI, newUI); revalidate(); repaint(); }
protected void setUI(ComponentUI newUI) { if (ui != null) ui.uninstallUI(this); ComponentUI oldUI = ui; ui = newUI; if (ui != null) ui.installUI(this); firePropertyChange("UI", oldUI, newUI); revalidate(); repaint(); }
3,255
public void setVisible(boolean v) { super.setVisible(v); revalidate(); repaint(); }
public void setVisible(boolean v) { super.setVisible(v); revalidate(); repaint(); }
3,256
public synchronized void setPixels(int x, int y, int w, int h, ColorModel model, byte[] pixels, int offset, int scansize) { ColorModel currentModel; if (model != null) currentModel = model; else currentModel = this.model; for(int yp = y; yp < (y + h); yp++) { for(int xp = x; xp < (x + w); xp++) { // Check if the coordinates (xp, yp) are within the // pixel block that we are grabbing. if(xp >= this.x && yp >= this.y && xp < (this.x + this.width) && yp < (this.y + this.height)) { int i = (yp - this.y) * this.scansize + (xp - this.x) + this.offset; int p = (yp - y) * scansize + (xp - x) + offset; if (forceRGB) { ints_delivered = true; int_pixel_buffer[i] = currentModel.getRGB (pixels[p]); } else { bytes_delivered = true; byte_pixel_buffer[i] = pixels[p]; } } } } }
public synchronized void setPixels(int x, int y, int w, int h, ColorModel model, byte[] pixels, int offset, int scansize) { ColorModel currentModel; if (model != null) currentModel = model; else currentModel = this.model; for(int yp = y; yp < (y + h); yp++) { for(int xp = x; xp < (x + w); xp++) { // Check if the coordinates (xp, yp) are within the // pixel block that we are grabbing. if(xp >= this.x && yp >= this.y && xp < (this.x + this.width) && yp < (this.y + this.height)) { int i = (yp - this.y) * this.scansize + (xp - this.x) + this.offset; int p = (yp - y) * scansize + (xp - x) + offset; if (forceRGB) { ints_delivered = true; int_pixel_buffer[i] = currentModel.getRGB (pixels[p] & 0xFF); } else { bytes_delivered = true; byte_pixel_buffer[i] = pixels[p]; } } } } }
3,257
public boolean isCanSendAid() { if (currentField != null && currentField.getAdjustment() > 0 && currentModified && !currentField.isCanSend()) return false; else return true; }
public boolean isCanSendAid() { if (currentField != null && currentField.getAdjustment() > 0 && currentModified && !currentField.isCanSend()) return false; else return true; }
3,258
public void setExtra(byte[] extra) { if (extra == null) { this.extra = null; return; } if (extra.length > 0xffff) throw new IllegalArgumentException(); this.extra = extra; try { int pos = 0; while (pos < extra.length) { int sig = (extra[pos++] & 0xff) | (extra[pos++] & 0xff) << 8; int len = (extra[pos++] & 0xff) | (extra[pos++] & 0xff) << 8; if (sig == 0x5455) { /* extended time stamp */ int flags = extra[pos]; if ((flags & 1) != 0) { long time = ((extra[pos+1] & 0xff) | (extra[pos+2] & 0xff) << 8 | (extra[pos+3] & 0xff) << 16 | (extra[pos+4] & 0xff) << 24); setTime(time); } } pos += len; } } catch (ArrayIndexOutOfBoundsException ex) { /* be lenient */ return; } }
public void setExtra(byte[] extra) { if (extra == null) { this.extra = null; return; } if (extra.length > 0xffff) throw new IllegalArgumentException(); this.extra = extra; try { int pos = 0; while (pos < extra.length) { int sig = (extra[pos++] & 0xff) | (extra[pos++] & 0xff) << 8; int len = (extra[pos++] & 0xff) | (extra[pos++] & 0xff) << 8; if (sig == 0x5455) { /* extended time stamp */ int flags = extra[pos]; if ((flags & 1) != 0) { long time = ((extra[pos+1] & 0xff) | (extra[pos+2] & 0xff) << 8 | (extra[pos+3] & 0xff) << 16 | (extra[pos+4] & 0xff) << 24); setTime(time); } } pos += len; } } catch (ArrayIndexOutOfBoundsException ex) { /* be lenient */ return; } }
3,260
public boolean loadAllInstruments(Soundbank soundbank) throws IllegalArgumentException;
public boolean loadAllInstruments(Soundbank soundbank) throws IllegalArgumentException;
3,261
public boolean loadInstrument(Instrument instrument) throws IllegalArgumentException;
public boolean loadInstrument(Instrument instrument) throws IllegalArgumentException;
3,262
public boolean loadInstruments(Soundbank soundbank, Patch[] patchList) throws IllegalArgumentException;
public boolean loadInstruments(Soundbank soundbank, Patch[] patchList) throws IllegalArgumentException;
3,263
public boolean remapInstrument(Instrument from, Instrument to) throws IllegalArgumentException;
public boolean remapInstrument(Instrument from, Instrument to) throws IllegalArgumentException;
3,264
public void unloadAllInstruments(Soundbank soundbank) throws IllegalArgumentException;
public void unloadAllInstruments(Soundbank soundbank) throws IllegalArgumentException;
3,265
public void unloadInstrument(Instrument instrument) throws IllegalArgumentException;
public void unloadInstrument(Instrument instrument) throws IllegalArgumentException;
3,266
public void unloadInstruments(Soundbank soundbank, Patch[] patchList) throws IllegalArgumentException;
public void unloadInstruments(Soundbank soundbank, Patch[] patchList) throws IllegalArgumentException;
3,267
public Ext2FileSystem(Device device, boolean readOnly) throws FileSystemException { super(device, readOnly); byte data[]; blockCache = new BlockCache(50,(float)0.75); inodeCache = new INodeCache(50,(float)0.75); groupDescriptorLock = new Object(); superblockLock = new Object(); try { data = new byte[Superblock.SUPERBLOCK_LENGTH]; //skip the first 1024 bytes (bootsector) and read the superblock //TODO: the superblock should read itself getApi().read(1024, data, 0, Superblock.SUPERBLOCK_LENGTH); superblock = new Superblock(data, this); //read the group descriptors groupCount = (int)Math.ceil((double)superblock.getBlocksCount() / (double)superblock.getBlocksPerGroup()); groupDescriptors = new GroupDescriptor[groupCount]; //OLD VERSION for(int i=0; i<groupCount; i++) { data=getBlock(superblock.getFirstDataBlock()+1); groupDescriptors[i] = new GroupDescriptor(data, this, i); } //OLD VERSION /* for(int i=0; i<groupCount; i++) { groupDescriptors[i]=new GroupDescriptor(i, this); } */ } catch (FileSystemException e) { throw e; } catch (Exception e) { throw new FileSystemException(e); } log.info( "Ext2fs filesystem constructed sucessfully"); log.debug( " superblock: #blocks: "+superblock.getBlocksCount()+"\n"+ " #blocks/group: "+superblock.getBlocksPerGroup()+"\n"+ " #block groups: "+groupCount+"\n"+ " block size: "+superblock.getBlockSize()+"\n"+ " #inodes: "+superblock.getINodesCount()+"\n"+ " #inodes/group: "+superblock.getINodesPerGroup()); }
public Ext2FileSystem(Device device, boolean readOnly) throws FileSystemException { super(device, readOnly); byte data[]; blockCache = new BlockCache(50,(float)0.75); inodeCache = new INodeCache(50,(float)0.75); groupDescriptorLock = new Object(); superblockLock = new Object(); try { data = new byte[Superblock.SUPERBLOCK_LENGTH]; //skip the first 1024 bytes (bootsector) and read the superblock //TODO: the superblock should read itself getApi().read(1024, data, 0, Superblock.SUPERBLOCK_LENGTH); superblock = new Superblock(data, this); //read the group descriptors groupCount = (int)Math.ceil((double)superblock.getBlocksCount() / (double)superblock.getBlocksPerGroup()); groupDescriptors = new GroupDescriptor[groupCount]; //OLD VERSION for(int i=0; i<groupCount; i++) { groupDescriptors[i] = new GroupDescriptor(data, this, i); } //OLD VERSION /* for(int i=0; i<groupCount; i++) { groupDescriptors[i]=new GroupDescriptor(i, this); } */ } catch (FileSystemException e) { throw e; } catch (Exception e) { throw new FileSystemException(e); } log.info( "Ext2fs filesystem constructed sucessfully"); log.debug( " superblock: #blocks: "+superblock.getBlocksCount()+"\n"+ " #blocks/group: "+superblock.getBlocksPerGroup()+"\n"+ " #block groups: "+groupCount+"\n"+ " block size: "+superblock.getBlockSize()+"\n"+ " #inodes: "+superblock.getINodesCount()+"\n"+ " #inodes/group: "+superblock.getINodesPerGroup()); }
3,268
public Ext2FileSystem(Device device, boolean readOnly) throws FileSystemException { super(device, readOnly); byte data[]; blockCache = new BlockCache(50,(float)0.75); inodeCache = new INodeCache(50,(float)0.75); groupDescriptorLock = new Object(); superblockLock = new Object(); try { data = new byte[Superblock.SUPERBLOCK_LENGTH]; //skip the first 1024 bytes (bootsector) and read the superblock //TODO: the superblock should read itself getApi().read(1024, data, 0, Superblock.SUPERBLOCK_LENGTH); superblock = new Superblock(data, this); //read the group descriptors groupCount = (int)Math.ceil((double)superblock.getBlocksCount() / (double)superblock.getBlocksPerGroup()); groupDescriptors = new GroupDescriptor[groupCount]; //OLD VERSION for(int i=0; i<groupCount; i++) { data=getBlock(superblock.getFirstDataBlock()+1); groupDescriptors[i] = new GroupDescriptor(data, this, i); } //OLD VERSION /* for(int i=0; i<groupCount; i++) { groupDescriptors[i]=new GroupDescriptor(i, this); } */ } catch (FileSystemException e) { throw e; } catch (Exception e) { throw new FileSystemException(e); } log.info( "Ext2fs filesystem constructed sucessfully"); log.debug( " superblock: #blocks: "+superblock.getBlocksCount()+"\n"+ " #blocks/group: "+superblock.getBlocksPerGroup()+"\n"+ " #block groups: "+groupCount+"\n"+ " block size: "+superblock.getBlockSize()+"\n"+ " #inodes: "+superblock.getINodesCount()+"\n"+ " #inodes/group: "+superblock.getINodesPerGroup()); }
public Ext2FileSystem(Device device, boolean readOnly) throws FileSystemException { super(device, readOnly); byte data[]; blockCache = new BlockCache(50,(float)0.75); inodeCache = new INodeCache(50,(float)0.75); groupDescriptorLock = new Object(); superblockLock = new Object(); try { data = new byte[Superblock.SUPERBLOCK_LENGTH]; //skip the first 1024 bytes (bootsector) and read the superblock //TODO: the superblock should read itself getApi().read(1024, data, 0, Superblock.SUPERBLOCK_LENGTH); superblock = new Superblock(data, this); //read the group descriptors groupCount = (int)Math.ceil((double)superblock.getBlocksCount() / (double)superblock.getBlocksPerGroup()); groupDescriptors = new GroupDescriptor[groupCount]; //OLD VERSION for(int i=0; i<groupCount; i++) { data=getBlock(superblock.getFirstDataBlock()+1); groupDescriptors[i] = new GroupDescriptor(data, this, i); } //OLD VERSION for(int i=0; i<groupCount; i++) { groupDescriptors[i]=new GroupDescriptor(i, this); } */ } catch (FileSystemException e) { throw e; } catch (Exception e) { throw new FileSystemException(e); } log.info( "Ext2fs filesystem constructed sucessfully"); log.debug( " superblock: #blocks: "+superblock.getBlocksCount()+"\n"+ " #blocks/group: "+superblock.getBlocksPerGroup()+"\n"+ " #block groups: "+groupCount+"\n"+ " block size: "+superblock.getBlockSize()+"\n"+ " #inodes: "+superblock.getINodesCount()+"\n"+ " #inodes/group: "+superblock.getINodesPerGroup()); }
3,269
public Ext2FileSystem(Device device, boolean readOnly) throws FileSystemException { super(device, readOnly); byte data[]; blockCache = new BlockCache(50,(float)0.75); inodeCache = new INodeCache(50,(float)0.75); groupDescriptorLock = new Object(); superblockLock = new Object(); try { data = new byte[Superblock.SUPERBLOCK_LENGTH]; //skip the first 1024 bytes (bootsector) and read the superblock //TODO: the superblock should read itself getApi().read(1024, data, 0, Superblock.SUPERBLOCK_LENGTH); superblock = new Superblock(data, this); //read the group descriptors groupCount = (int)Math.ceil((double)superblock.getBlocksCount() / (double)superblock.getBlocksPerGroup()); groupDescriptors = new GroupDescriptor[groupCount]; //OLD VERSION for(int i=0; i<groupCount; i++) { data=getBlock(superblock.getFirstDataBlock()+1); groupDescriptors[i] = new GroupDescriptor(data, this, i); } //OLD VERSION /* for(int i=0; i<groupCount; i++) { groupDescriptors[i]=new GroupDescriptor(i, this); } */ } catch (FileSystemException e) { throw e; } catch (Exception e) { throw new FileSystemException(e); } log.info( "Ext2fs filesystem constructed sucessfully"); log.debug( " superblock: #blocks: "+superblock.getBlocksCount()+"\n"+ " #blocks/group: "+superblock.getBlocksPerGroup()+"\n"+ " #block groups: "+groupCount+"\n"+ " block size: "+superblock.getBlockSize()+"\n"+ " #inodes: "+superblock.getINodesCount()+"\n"+ " #inodes/group: "+superblock.getINodesPerGroup()); }
public Ext2FileSystem(Device device, boolean readOnly) throws FileSystemException { super(device, readOnly); byte data[]; blockCache = new BlockCache(50,(float)0.75); inodeCache = new INodeCache(50,(float)0.75); groupDescriptorLock = new Object(); superblockLock = new Object(); try { data = new byte[Superblock.SUPERBLOCK_LENGTH]; //skip the first 1024 bytes (bootsector) and read the superblock //TODO: the superblock should read itself getApi().read(1024, data, 0, Superblock.SUPERBLOCK_LENGTH); superblock = new Superblock(data, this); //read the group descriptors groupCount = (int)Math.ceil((double)superblock.getBlocksCount() / (double)superblock.getBlocksPerGroup()); groupDescriptors = new GroupDescriptor[groupCount]; //OLD VERSION for(int i=0; i<groupCount; i++) { data=getBlock(superblock.getFirstDataBlock()+1); groupDescriptors[i] = new GroupDescriptor(data, this, i); } //OLD VERSION /* for(int i=0; i<groupCount; i++) { groupDescriptors[i]=new GroupDescriptor(i, this); } } catch (FileSystemException e) { throw e; } catch (Exception e) { throw new FileSystemException(e); } log.info( "Ext2fs filesystem constructed sucessfully"); log.debug( " superblock: #blocks: "+superblock.getBlocksCount()+"\n"+ " #blocks/group: "+superblock.getBlocksPerGroup()+"\n"+ " #block groups: "+groupCount+"\n"+ " block size: "+superblock.getBlockSize()+"\n"+ " #inodes: "+superblock.getINodesCount()+"\n"+ " #inodes/group: "+superblock.getINodesPerGroup()); }
3,270
public byte[] getBlock(long nr) throws IOException{ //log.debug("blockCache size: "+blockCache.size()); int blockSize = superblock.getBlockSize(); Block result; Integer key=new Integer((int)(nr)); synchronized(blockCache) { //check if the block has already been retrieved if(blockCache.containsKey(key)) result=(Block)blockCache.get(key); else{ byte[] data = new byte[blockSize]; //api.read( nr*blockSize, data, 0, blockSize ); timedRead(nr, data); result=new Block(this, nr, data); blockCache.put(key, result); } } return result.getData(); }
public byte[] getBlock(long nr) throws IOException{ //log.debug("blockCache size: "+blockCache.size()); int blockSize = superblock.getBlockSize(); Block result; Integer key=new Integer((int)(nr)); synchronized(blockCache) { //check if the block has already been retrieved if(blockCache.containsKey(key)) result=(Block)blockCache.get(key); else{ byte[] data = new byte[blockSize]; //api.read( nr*blockSize, data, 0, blockSize ); getApi().read( nr*blockSize, data, 0, blockSize ); result=new Block(this, nr, data); blockCache.put(key, result); } } return result.getData(); }
3,271
public long getBlockSize() { return superblock.getBlockSize(); }
public int getBlockSize() { return superblock.getBlockSize(); }
3,272
protected void modifyUsedDirsCount(int group, int diff) throws IOException { GroupDescriptor gdesc = groupDescriptors[group]; synchronized(gdesc) { gdesc.setUsedDirsCount( gdesc.getUsedDirsCount()+diff ); } }
protected void modifyUsedDirsCount(int group, int diff) { GroupDescriptor gdesc = groupDescriptors[group]; synchronized(gdesc) { gdesc.setUsedDirsCount( gdesc.getUsedDirsCount()+diff ); } }
3,273
public void writeBlock(long nr, byte[] data, boolean forceWrite) throws IOException { if(isReadOnly()) throw new ReadOnlyFileSystemException("Filesystem is mounted read-only!"); Block block; Integer key=new Integer((int)nr); //check if the block is in the cache synchronized(blockCache) { if(blockCache.containsKey(key)) { block = (Block)blockCache.get(key); //update the data in the cache block.setData(data); if(forceWrite || SYNC_WRITE) { //write the block to disk //api.write(nr*blockSize, data, 0, blockSize); timedWrite(nr, data); block.setDirty(false); log.debug("writing block "+nr+" to disk"); } else block.setDirty(true); } else { //If the block was not in the cache, I see no reason to put it //in the cache when it is written. //It is simply written to disk. //api.write(nr*blockSize, data, 0, blockSize); timedWrite(nr, data); } } }
public void writeBlock(long nr, byte[] data, boolean forceWrite) throws IOException { if(isReadOnly()) throw new ReadOnlyFileSystemException("Filesystem is mounted read-only!"); Block block; Integer key=new Integer((int)nr); //check if the block is in the cache synchronized(blockCache) { if(blockCache.containsKey(key)) { block = (Block)blockCache.get(key); //update the data in the cache block.setData(data); if(forceWrite || SYNC_WRITE) { //write the block to disk //api.write(nr*blockSize, data, 0, blockSize); getApi().write(nr*blockSize, data, 0, blockSize); block.setDirty(false); log.debug("writing block "+nr+" to disk"); } else block.setDirty(true); } else { //If the block was not in the cache, I see no reason to put it //in the cache when it is written. //It is simply written to disk. //api.write(nr*blockSize, data, 0, blockSize); getApi().write(nr*blockSize, data, 0, blockSize); } } }
3,274
public KeyException(String msg) { super(msg); }
public KeyException() { super(msg); }
3,276
public KeyException(String msg) { super(msg); }
public KeyException(String msg) { }
3,277
public Button() { this(null); }
Button() { this(null); }
3,278
public synchronized void addActionListener(ActionListener listener) { action_listeners = AWTEventMulticaster.add(action_listeners, listener); }
addActionListener(ActionListener listener) { action_listeners = AWTEventMulticaster.add(action_listeners, listener); }
3,279
public void addNotify() { if (peer == null) peer = getToolkit().createButton(this); super.addNotify(); }
addNotify() { if (peer == null) peer = getToolkit().createButton(this); super.addNotify(); }
3,280
void dispatchEventImpl(AWTEvent e) { if (e.id <= ActionEvent.ACTION_LAST && e.id >= ActionEvent.ACTION_FIRST && (action_listeners != null || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
void dispatchEventImpl(AWTEvent e) { if (e.id <= ActionEvent.ACTION_LAST && e.id >= ActionEvent.ACTION_FIRST && (action_listeners != null || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
3,281
public String getActionCommand() { return (actionCommand); }
public String getActionCommand() { return (actionCommand); }
3,282
public String getLabel() { return (label); }
public String getLabel() { return (label); }
3,283
protected String paramString() { return ("label=" + getLabel() + ",actionCommand=" + getActionCommand() + "," + super.paramString()); }
protected String paramString() { return ("label=" + getLabel() + ",actionCommand=" + getActionCommand() + "," + super.paramString()); }
3,284
protected void processActionEvent(ActionEvent event) { if (action_listeners != null) action_listeners.actionPerformed(event); }
processActionEvent(ActionEvent event) { if (action_listeners != null) action_listeners.actionPerformed(event); }
3,285
protected void processEvent(AWTEvent event) { if (event instanceof ActionEvent) processActionEvent((ActionEvent) event); else super.processEvent(event); }
processEvent(AWTEvent event) { if (event instanceof ActionEvent) processActionEvent((ActionEvent) event); else super.processEvent(event); }
3,286
public synchronized void removeActionListener(ActionListener listener) { action_listeners = AWTEventMulticaster.remove(action_listeners, listener); }
removeActionListener(ActionListener listener) { action_listeners = AWTEventMulticaster.remove(action_listeners, listener); }
3,287
public void setActionCommand(String actionCommand) { this.actionCommand = actionCommand == null ? label : actionCommand; }
setActionCommand(String actionCommand) { this.actionCommand = actionCommand == null ? label : actionCommand; }
3,288
public synchronized void setLabel(String label) { this.label = label; if (peer != null) { ButtonPeer bp = (ButtonPeer) peer; bp.setLabel(label); } }
setLabel(String label) { this.label = label; if (peer != null) { ButtonPeer bp = (ButtonPeer) peer; bp.setLabel(label); } }
3,289
public synchronized void setLabel(String label) { this.label = label; if (peer != null) { ButtonPeer bp = (ButtonPeer) peer; bp.setLabel(label); } }
public synchronized void setLabel(String label) { this.label = label; actionCommand = label; if (peer != null) { ButtonPeer bp = (ButtonPeer) peer; bp.setLabel(label); } }
3,290
public synchronized void setLabel(String label) { this.label = label; if (peer != null) { ButtonPeer bp = (ButtonPeer) peer; bp.setLabel(label); } }
public synchronized void setLabel(String label) { this.label = label; if (peer != null) { ButtonPeer bp = (ButtonPeer) peer; bp.setLabel(label); } }
3,291
public int getDimension() { return getDataCube().getDimension(); }
public int getDimension() { return getAxes().size(); }
3,293
public boolean removeAxis (AxisInterface axisObj) { boolean isRemoveSuccess = removeFromList(axisObj, getAxes(), AXISLIST_XML_ATTRIBUTE_NAME); if (isRemoveSuccess) { //remove successful getDataCube().decrementDimension(axisObj); //decrease the dimension by 1 updateChildLocators(axisObj, "remove"); } return isRemoveSuccess; }
public boolean removeAxis (AxisInterface axisObj) { boolean isRemoveSuccess = removeFromList(axisObj, getAxes(), AXISLIST_XML_ATTRIBUTE_NAME); if (isRemoveSuccess) { //remove successful getDataCube().decrementDimension(axisObj); //decrease the dimension by 1 updateChildLocators(axisObj, "remove"); } return isRemoveSuccess; }
3,294
public void setAxisList(List axisList) { // remove the existing axes List oldAxisList = getAxes(); for (int i=0;i<oldAxisList.size();i++) removeAxis(i++); //add new axes if (axisList != null && axisList.size() > 0) { Iterator iter = axisList.iterator(); while (iter.hasNext()) addAxis((Axis) iter.next()); } }
public void setAxisList(List axisList) { // remove the existing axes List oldAxisList = getAxes(); for (int i=0;i<oldAxisList.size();i++) removeAxis(i++); //add new axes if (axisList != null && axisList.size() > 0) { Iterator iter = axisList.iterator(); while (iter.hasNext()) addAxis((Axis) iter.next()); } }
3,295
public void setAxisList(List axisList) { // remove the existing axes List oldAxisList = getAxes(); for (int i=0;i<oldAxisList.size();i++) removeAxis(i++); //add new axes if (axisList != null && axisList.size() > 0) { Iterator iter = axisList.iterator(); while (iter.hasNext()) addAxis((Axis) iter.next()); } }
public void setAxisList(List axisList) { // remove the existing axes List oldAxisList = getAxes(); for (int i=0;i<oldAxisList.size();i++) removeAxis(i++); //add new axes if (axisList != null && axisList.size() > 0) { Iterator iter = axisList.iterator(); while (iter.hasNext()) addAxis((AxisInterface) iter.next()); } }
3,296
protected void paintBorder(Graphics graphics) { getBorder().paintBorder(this, graphics, 0, 0, getWidth(), getHeight()); }
protected void paintBorder(Graphics graphics) { Border border = getBorder(); if (paintBorder && border != null) border.paintBorder(this, graphics, 0, 0, getWidth(), getHeight()); }
3,297
public void transmit(SocketBuffer buf, HardwareAddress destination, long timeout) throws InterruptedException, TimeoutException { log.debug(flags.getName() + " : Init transmit with TIMEOUT=" + timeout); // Set the source address hwAddress.writeTo(buf, 6); log.debug("Source : " +((EthernetHeader)buf.getLinkLayerHeader()).getSource().toString()); log.debug("Destination : " + ((EthernetHeader)buf.getLinkLayerHeader()).getDestination().toString()); buffers.transmit(buf); log.debug(flags.getName() + " : End transmit"); }
public void transmit(SocketBuffer buf, HardwareAddress destination, long timeout) throws InterruptedException, TimeoutException { log.debug(flags.getName() + " : Init transmit with TIMEOUT=" + timeout); // Set the source address hwAddress.writeTo(buf, 6); log.debug("Source : " +((EthernetHeader)buf.getLinkLayerHeader()).getSource().toString()); log.debug("Destination : " + ((EthernetHeader)buf.getLinkLayerHeader()).getDestination().toString()); buffers.transmit(buf); log.debug(flags.getName() + " : End transmit"); }
3,298
protected void configurePropertiesFromAction(Action action) { super.configurePropertiesFromAction(action); if (! (this instanceof JMenu) && action != null) setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY))); }
protected void configurePropertiesFromAction(Action action) { super.configurePropertiesFromAction(action); if (! (this instanceof JMenu) && action != null) { setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY))); super.registerKeyboardAction(action, accelerator, JComponent.WHEN_IN_FOCUSED_WINDOW); } }
3,299
public int getEndOffset() { int end = 0; if (getElementCount() == 0) end = getLength(); // FIXME: That ain't correct, fix it. else end = children[children.length - 1].getEndOffset(); return end; }
public int getEndOffset() { int end = 0; if (getElementCount() == 0) end = getLength(); // FIXME: That ain't correct, fix it. else end = children[children.length - 1].getEndOffset(); return end; }
3,301
public int getEndOffset() { int end = 0; if (getElementCount() == 0) end = getLength(); // FIXME: That ain't correct, fix it. else end = children[children.length - 1].getEndOffset(); return end; }
public int getEndOffset() { int end = 0; if (getElementCount() == 0) end = getLength(); // FIXME: That ain't correct, fix it. else end = children[children.length - 1].getEndOffset(); return end; }
3,302
public int getStartOffset() { int start = 0; if (getElementCount() == 0) start = 0; // FIXME: That ain't correct, fix it. else start = children[0].getStartOffset(); return start; }
public int getStartOffset() { int start = 0; if (getElementCount() == 0) start = 0; // FIXME: That ain't correct, fix it. else start = children[0].getStartOffset(); return start; }
3,303
public int getStartOffset() { int start = 0; if (getElementCount() == 0) start = 0; // FIXME: That ain't correct, fix it. else start = children[0].getStartOffset(); return start; }
public int getStartOffset() { int start = 0; if (getElementCount() == 0) start = 0; // FIXME: That ain't correct, fix it. else start = children[0].getStartOffset(); return start; }
3,304
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); { try { if (parent != null) { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } else { startPos = createPosition(start); endPos = createPosition(end); } } catch (BadLocationException ex) { AssertionError as; as = new AssertionError("BadLocationException thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); as.initCause(ex); throw as; } } }
public LeafElement(Element parent, AttributeSet attributes, int start, int end) int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len; super(parent, attributes); int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len; try int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len; if (parent != null) int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len; startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } else int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len; startPos = createPosition(start); endPos = createPosition(end); } } catch (BadLocationException ex) int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len; AssertionError as; as = new AssertionError("BadLocationException thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); as.initCause(ex); throw as; } } }
3,305
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); { try { if (parent != null) { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } else { startPos = createPosition(start); endPos = createPosition(end); } } catch (BadLocationException ex) { AssertionError as; as = new AssertionError("BadLocationException thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); as.initCause(ex); throw as; } } }
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); { try { if (parent != null) { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } else { startPos = createPosition(start); endPos = createPosition(end); } } catch (BadLocationException ex) { AssertionError as; as = new AssertionError("BadLocationException thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); as.initCause(ex); throw as; } } }
3,306
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); { try { if (parent != null) { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } else { startPos = createPosition(start); endPos = createPosition(end); } } catch (BadLocationException ex) { AssertionError as; as = new AssertionError("BadLocationException thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); as.initCause(ex); throw as; } } }
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); { try { if (parent != null) { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); else { startPos = createPosition(start); endPos = createPosition(end); catch (BadLocationException ex) { AssertionError as; as = new AssertionError("BadLocationException thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); as.initCause(ex); throw as;
3,307
public int getEndOffset() { return endPos.getOffset(); }
public int getEndOffset() { return endPos.getOffset() + endDelta; }
3,308
public int getStartOffset() { return startPos.getOffset(); }
public int getStartOffset() { return startPos.getOffset() + startDelta; }
3,309