rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
dot = textComp.getCaretPosition(); return dot; | return JTextComponent.this.getCaretPosition(); | public int getCaretPosition() { dot = textComp.getCaretPosition(); return dot; } |
return textComp.getText().length(); | return JTextComponent.this.getText().length(); | public int getCharCount() { return textComp.getText().length(); } |
throws NotImplementedException | public AttributeSet getCharacterAttribute(int index) throws NotImplementedException { return null; // TODO } |
|
return null; | AttributeSet atts; if (doc instanceof AbstractDocument) ((AbstractDocument) doc).readLock(); try { Element el = doc.getDefaultRootElement(); while (! el.isLeaf()) { int i = el.getElementIndex(index); el = el.getElement(i); } atts = el.getAttributes(); } finally { if (doc instanceof AbstractDocument) ((AbstractDocument) doc).readUnlock(); } return atts; | public AttributeSet getCharacterAttribute(int index) throws NotImplementedException { return null; // TODO } |
throws NotImplementedException | public Rectangle getCharacterBounds(int index) throws NotImplementedException { return null; // TODO } |
|
return null; | Rectangle bounds = null; if (index >= 0 && index < doc.getLength() - 1) { if (doc instanceof AbstractDocument) ((AbstractDocument) doc).readLock(); try { TextUI ui = getUI(); if (ui != null) { Rectangle rect = new Rectangle(); Insets insets = getInsets(); rect.x = insets.left; rect.y = insets.top; rect.width = getWidth() - insets.left - insets.right; rect.height = getHeight() - insets.top - insets.bottom; View rootView = ui.getRootView(JTextComponent.this); if (rootView != null) { rootView.setSize(rect.width, rect.height); Shape s = rootView.modelToView(index, Position.Bias.Forward, index + 1, Position.Bias.Backward, rect); if (s != null) bounds = s.getBounds(); } } } catch (BadLocationException ex) { } finally { if (doc instanceof AbstractDocument) ((AbstractDocument) doc).readUnlock(); } } return bounds; | public Rectangle getCharacterBounds(int index) throws NotImplementedException { return null; // TODO } |
throws NotImplementedException | public int getIndexAtPoint(Point p) throws NotImplementedException { return 0; // TODO } |
|
return 0; | return viewToModel(p); | public int getIndexAtPoint(Point p) throws NotImplementedException { return 0; // TODO } |
return textComp.getSelectedText(); | return JTextComponent.this.getSelectedText(); | public String getSelectedText() { return textComp.getSelectedText(); } |
if (getSelectedText() == null || (textComp.getText().equals(""))) return 0; return textComp.getSelectionEnd(); | return JTextComponent.this.getSelectionEnd(); | public int getSelectionEnd() { if (getSelectedText() == null || (textComp.getText().equals(""))) return 0; return textComp.getSelectionEnd(); } |
if (getSelectedText() == null || (textComp.getText().equals(""))) | if (getSelectedText() == null || (JTextComponent.this.getText().equals(""))) | public int getSelectionStart() { if (getSelectedText() == null || (textComp.getText().equals(""))) return 0; return textComp.getSelectionStart(); } |
return textComp.getSelectionStart(); | return JTextComponent.this.getSelectionStart(); | public int getSelectionStart() { if (getSelectedText() == null || (textComp.getText().equals(""))) return 0; return textComp.getSelectionStart(); } |
return textComp.getText(start, end - start); | return JTextComponent.this.getText(start, end - start); | public String getTextRange(int start, int end) { try { return textComp.getText(start, end - start); } catch (BadLocationException ble) { return ""; } } |
throws NotImplementedException | public void insertTextAtIndex(int index, String s) throws NotImplementedException { replaceText(index, index, s); } |
|
replaceText(index, index, s); | try { doc.insertString(index, s, null); } catch (BadLocationException ex) { ex.printStackTrace(); } | public void insertTextAtIndex(int index, String s) throws NotImplementedException { replaceText(index, index, s); } |
throws NotImplementedException | public void insertUpdate(DocumentEvent e) throws NotImplementedException { // TODO } |
|
firePropertyChange(ACCESSIBLE_TEXT_PROPERTY, null, new Integer(e.getOffset())); | public void insertUpdate(DocumentEvent e) throws NotImplementedException { // TODO } |
|
textComp.setCaretPosition(start); textComp.paste(); | JTextComponent.this.setCaretPosition(start); JTextComponent.this.paste(); | public void paste(int start) { textComp.setCaretPosition(start); textComp.paste(); } |
throws NotImplementedException | public void removeUpdate(DocumentEvent e) throws NotImplementedException { // TODO } |
|
firePropertyChange(ACCESSIBLE_TEXT_PROPERTY, null, new Integer(e.getOffset())); | public void removeUpdate(DocumentEvent e) throws NotImplementedException { // TODO } |
|
textComp.select(start, end); textComp.replaceSelection(s); | JTextComponent.this.select(start, end); JTextComponent.this.replaceSelection(s); | public void replaceText(int start, int end, String s) { textComp.select(start, end); textComp.replaceSelection(s); } |
textComp.select(start, end); | JTextComponent.this.select(start, end); | public void selectText(int start, int end) { textComp.select(start, end); } |
throws NotImplementedException | public void setAttributes(int start, int end, AttributeSet s) throws NotImplementedException { // TODO } |
|
if (doc instanceof StyledDocument) { StyledDocument sdoc = (StyledDocument) doc; sdoc.setCharacterAttributes(start, end - start, s, true); } | public void setAttributes(int start, int end, AttributeSet s) throws NotImplementedException { // TODO } |
|
throws NotImplementedException | public void setTextContents(String s) throws NotImplementedException { // TODO } |
|
setText(s); | public void setTextContents(String s) throws NotImplementedException { // TODO } |
|
if (getParent() instanceof JViewport) return getParent().getWidth() > getPreferredSize().width; | boolean res = false;; Container c = getParent(); if (c instanceof JViewport) res = ((JViewport) c).getExtentSize().width > getPreferredSize().width; | public boolean getScrollableTracksViewportWidth() { if (getParent() instanceof JViewport) return getParent().getWidth() > getPreferredSize().width; return false; } |
return false; | return res; | public boolean getScrollableTracksViewportWidth() { if (getParent() instanceof JViewport) return getParent().getWidth() > getPreferredSize().width; return false; } |
} finally { if (oldDoc instanceof AbstractDocument) ((AbstractDocument) oldDoc).readUnlock(); } | public void setDocument(Document newDoc) { Document oldDoc = doc; doc = newDoc; firePropertyChange("document", oldDoc, newDoc); revalidate(); repaint(); } |
|
screen52.setCursorOff(); | screen52.setCursorActive(false); | public final void hostPrint(int aid) { if (screen52.isStatusErrorCode()) { screen52.restoreErrorLine(); screen52.setStatus(screen52.STATUS_ERROR_CODE,screen52.STATUS_VALUE_OFF,null); } screen52.setCursorOff(); screen52.setStatus(screen52.STATUS_SYSTEM,screen52.STATUS_VALUE_ON,null); // From client access ip capture // it seems to use an operation code of 3 and 4 // also note that the flag field that says reserved is being sent as well // with a value of 0x80 // // I have tried with not setting these flags and sending with 3 or 1 // there is no effect and I still get a host print screen. Go figure //0000: 000D 12A0 0000 0400 8003 1407 F6FFEF //0000: 000D 12A0 0000 0400 8001 110E F6FFEF // // Client sends header 000D12A0000004000003####F6FFEF // operation code 3 // row - first ## // column - second ## // F6 - Print Aid Key baosp.write(screen52.getCurrentRow()); baosp.write(screen52.getCurrentCol()); baosp.write(AID_PRINT); // aid key try { writeGDS(0, 3, baosp.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } baosp.reset(); } |
screen52.setCursorOff(); | screen52.setCursorActive(false); | private final void readImmediate(int readType) { if (screen52.isStatusErrorCode()) { screen52.restoreErrorLine(); screen52.setStatus(screen52.STATUS_ERROR_CODE,screen52.STATUS_VALUE_OFF,null); } if (!enhanced) { screen52.setCursorOff(); } screen52.setStatus(screen52.STATUS_SYSTEM,screen52.STATUS_VALUE_ON,null); screen52.setKeyboardLocked(true); pendingUnlock = false; invited = false; screen52.getScreenFields().readFormatTable(baosp,readType,codePage); try { writeGDS(0, 3, baosp.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); baosp.reset(); } baosp.reset(); } |
screen52.setCursorOff(); | screen52.setCursorActive(false); | public void run () { while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); invited = false; screen52.setCursorOff();// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); signOnSave = screen52.getScreenAsChars(); System.out.println("Signon saved"); } break; case 4:// System.out.println("Save Screen Operation"); parseIncoming(); break; case 5:// System.out.println("Restore Screen Operation"); parseIncoming(); break; case 6:// System.out.println("Read Immediate"); sendAidKey(0); break; case 7:// System.out.println("Reserved"); break; case 8:// System.out.println("Read Screen Operation"); try { readScreen(); } catch (IOException ex) { } break; case 9:// System.out.println("Reserved"); break; case 10:// System.out.println("Cancel Invite Operation"); cancelInvite(); break; case 11:// System.out.println("Turn on message light"); screen52.setMessageLightOn(); screen52.setCursorOn(); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorOn(); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorOn(); cursorOn = false; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); } } |
screen52.setCursorOn(); | screen52.setCursorActive(true); | public void run () { while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); invited = false; screen52.setCursorOff();// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); signOnSave = screen52.getScreenAsChars(); System.out.println("Signon saved"); } break; case 4:// System.out.println("Save Screen Operation"); parseIncoming(); break; case 5:// System.out.println("Restore Screen Operation"); parseIncoming(); break; case 6:// System.out.println("Read Immediate"); sendAidKey(0); break; case 7:// System.out.println("Reserved"); break; case 8:// System.out.println("Read Screen Operation"); try { readScreen(); } catch (IOException ex) { } break; case 9:// System.out.println("Reserved"); break; case 10:// System.out.println("Cancel Invite Operation"); cancelInvite(); break; case 11:// System.out.println("Turn on message light"); screen52.setMessageLightOn(); screen52.setCursorOn(); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorOn(); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorOn(); cursorOn = false; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); } } |
screen52.setCursorOff(); | screen52.setCursorActive(false); | public final boolean sendAidKey(int aid) { if (screen52.isStatusErrorCode()) { screen52.restoreErrorLine(); screen52.setStatus(screen52.STATUS_ERROR_CODE,screen52.STATUS_VALUE_OFF,null); } if (!enhanced) { screen52.setCursorOff(); } screen52.setStatus(screen52.STATUS_SYSTEM,screen52.STATUS_VALUE_ON,null); screen52.setKeyboardLocked(true); pendingUnlock = false; invited = false; baosp.write(screen52.getCurrentRow()); baosp.write(screen52.getCurrentCol()); baosp.write(aid); if (dataIncluded(aid)) screen52.getScreenFields().readFormatTable(baosp,readType,codePage); try { writeGDS(0, 3, baosp.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); baosp.reset(); return false; } baosp.reset(); return true; } |
Item(int kind, int offsetToFP) { assertCondition(kind > 0, "Invalid kind"); this.kind = kind; this.offsetToFP = offsetToFP; | protected Item(ItemFactory factory) { this.factory = factory; if (true) { final Vm vm = Vm.getVm(); final String name = getClass().getName(); final Counter cnt = vm.getCounter(name); cnt.inc(); } | Item(int kind, int offsetToFP) { assertCondition(kind > 0, "Invalid kind"); this.kind = kind; this.offsetToFP = offsetToFP; } |
if (isFER() && cursorPos > endPos) { return true; } if (isSignedNumeric() && cursorPos < endPos - 1) { return false; } | protected boolean isCanSend() { int adj = getAdjustment(); if (adj > 0) { switch (adj) { case 5: case 6: return rightAdjd; case 7: return manditoried; default: return true; } } return true; } |
|
put(w, "ethernet0.present", "TRUE"); put(w, "ethernet0.connectionType", "bridged"); | final String osName = System.getProperty("os.name").toLowerCase(); if(osName.contains("linux") || osName.contains("unix") || osName.contains("bsd")) { put(w, "ethernet0.connectionType", "bridged"); put(w, "ethernet0.vnet", "/dev/vmnet1"); } | public void execute() throws BuildException { try { FileWriter out = new FileWriter(new File(isoFile + ".vmx")); try { PrintWriter w = new PrintWriter(out); put(w, "config.version", "8"); put(w, "virtualHW.version", "4"); put(w, "memsize", String.valueOf(memorySize)); put(w, "MemAllowAutoScaleDown", "FALSE"); put(w, "ide0:0.present", "TRUE"); put(w, "ide0:0.fileName", new File(isoFile).getName()); put(w, "ide0:0.deviceType", "cdrom-image"); put(w, "ide1:0.present", "FALSE"); put(w, "floppy0.present", "FALSE"); put(w, "usb.present", "TRUE"); put(w, "sound.present", "FALSE"); put(w, "sound.virtualDev", "es1371"); put(w, "displayName", "JNode"); put(w, "guestOS", "dos"); put(w, "nvram", "JNode.nvram"); put(w, "MemTrimRate", "-1"); put(w, "ide0:0.redo", ""); put(w, "ethernet0.present", "TRUE"); put(w, "ethernet0.connectionType", "bridged"); put(w, "ethernet0.addressType", "generated"); put(w, "ethernet0.generatedAddress", "00:0c:29:2a:96:30"); put(w, "ethernet0.generatedAddressOffset", "0"); put(w, "ethernet0.vnet", "/dev/vmnet1"); put(w, "ethernet0.startConnected", "TRUE"); put(w, "uuid.location", "56 4d 94 59 c9 96 80 88-6c 3a 37 80 04 68 c9 b2"); put(w, "uuid.bios", "56 4d 94 59 c9 96 80 88-6c 3a 37 80 04 68 c9 b2"); if((logFile != null) && (logFile.trim().length() != 0)) { put(w, "serial0.present", "TRUE"); put(w, "serial0.fileType", "file"); put(w, "serial0.fileName", logFile); } put(w, "tools.syncTime", "TRUE"); put(w, "ide1:0.startConnected", "TRUE"); put(w, "uuid.action", "create"); put(w, "checkpoint.vmState", ""); } finally { out.close(); } } catch (IOException ex) { throw new BuildException(ex); } } |
put(w, "ethernet0.vnet", "/dev/vmnet1"); | put(w, "ethernet0.present", "TRUE"); | public void execute() throws BuildException { try { FileWriter out = new FileWriter(new File(isoFile + ".vmx")); try { PrintWriter w = new PrintWriter(out); put(w, "config.version", "8"); put(w, "virtualHW.version", "4"); put(w, "memsize", String.valueOf(memorySize)); put(w, "MemAllowAutoScaleDown", "FALSE"); put(w, "ide0:0.present", "TRUE"); put(w, "ide0:0.fileName", new File(isoFile).getName()); put(w, "ide0:0.deviceType", "cdrom-image"); put(w, "ide1:0.present", "FALSE"); put(w, "floppy0.present", "FALSE"); put(w, "usb.present", "TRUE"); put(w, "sound.present", "FALSE"); put(w, "sound.virtualDev", "es1371"); put(w, "displayName", "JNode"); put(w, "guestOS", "dos"); put(w, "nvram", "JNode.nvram"); put(w, "MemTrimRate", "-1"); put(w, "ide0:0.redo", ""); put(w, "ethernet0.present", "TRUE"); put(w, "ethernet0.connectionType", "bridged"); put(w, "ethernet0.addressType", "generated"); put(w, "ethernet0.generatedAddress", "00:0c:29:2a:96:30"); put(w, "ethernet0.generatedAddressOffset", "0"); put(w, "ethernet0.vnet", "/dev/vmnet1"); put(w, "ethernet0.startConnected", "TRUE"); put(w, "uuid.location", "56 4d 94 59 c9 96 80 88-6c 3a 37 80 04 68 c9 b2"); put(w, "uuid.bios", "56 4d 94 59 c9 96 80 88-6c 3a 37 80 04 68 c9 b2"); if((logFile != null) && (logFile.trim().length() != 0)) { put(w, "serial0.present", "TRUE"); put(w, "serial0.fileType", "file"); put(w, "serial0.fileName", logFile); } put(w, "tools.syncTime", "TRUE"); put(w, "ide1:0.startConnected", "TRUE"); put(w, "uuid.action", "create"); put(w, "checkpoint.vmState", ""); } finally { out.close(); } } catch (IOException ex) { throw new BuildException(ex); } } |
Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); TreeCellRenderer tcr = getCellRenderer(); Icon icon; if (isLeaf) icon = UIManager.getIcon("Tree.leafIcon"); else if (tree.isExpanded(path)) icon = UIManager.getIcon("Tree.openIcon"); else icon = UIManager.getIcon("Tree.closedIcon"); if (tcr instanceof DefaultTreeCellRenderer) { Icon tmp = ((DefaultTreeCellRenderer) tcr).getIcon(); if (tmp != null) icon = tmp; } if (icon != null) bounds.width += icon.getIconWidth() + gap*2; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { selectPath(tree, path); if (inBounds && e.getClickCount() == 2 && !isLeaf(row)) toggleExpandState(path); if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); } else if (tree.isEditable()) startEditing(path, e); } } | public void mousePressed(MouseEvent e) { } |
|
this.source = source; this.destination = destination; | public MouseInputHandler(Component source, Component destination, MouseEvent e) { } |
|
Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); if (isLeaf) bounds.width += rightChildIndent + gap; else if (hasControlIcons()) bounds.width += getCurrentControlIcon(path).getIconWidth() + gap; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { selectPath(tree, path); if (inBounds && e.getClickCount() == 2 && !isLeaf(row)) toggleExpandState(path); if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); } else if (tree.isEditable()) startEditing(path, e); } } | public void mousePressed(MouseEvent e) { Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); boolean cntlClick = isLocationInExpandControl(path, click.x, click.y); boolean isLeaf = isLeaf(row); if (isLeaf) bounds.width += rightChildIndent + gap; else if (hasControlIcons()) bounds.width += getCurrentControlIcon(path).getIconWidth() + gap; boolean inBounds = bounds.contains(click.x, click.y); if ((inBounds || cntlClick) && tree.isVisible(path)) { selectPath(tree, path); if (inBounds && e.getClickCount() == 2 && !isLeaf(row)) toggleExpandState(path); if (cntlClick) { handleExpandControlClick(path, click.x, click.y); if (cellEditor != null) cellEditor.cancelCellEditing(); } else if (tree.isEditable()) startEditing(path, e); } } } |
|
updateCurrentVisiblePath(); | public void treeCollapsed(TreeExpansionEvent event) { validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); } |
|
updateCurrentVisiblePath(); | public void treeExpanded(TreeExpansionEvent event) { validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); } |
|
updateCurrentVisiblePath(); | public void treeNodesChanged(TreeModelEvent e) { validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); } |
|
updateCurrentVisiblePath(); | public void treeNodesInserted(TreeModelEvent e) { validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); } |
|
updateCurrentVisiblePath(); | public void treeNodesRemoved(TreeModelEvent e) { validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); } |
|
updateCurrentVisiblePath(); | public void treeStructureChanged(TreeModelEvent e) { validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); } |
|
this.direction = direction; | public TreePageAction(int direction, String name) { } |
|
this.direction = direction; | public TreeTraverseAction(int direction, String name) { } |
|
mouseInputListener = new MouseInputHandler(null, null, null); | mouseListener = createMouseListener(); | public BasicTreeUI() { validCachedPreferredSize = false; drawingCache = new Hashtable(); nodeDimensions = createNodeDimensions(); configureLayoutCache(); propertyChangeListener = createPropertyChangeListener(); focusListener = createFocusListener(); treeSelectionListener = createTreeSelectionListener(); mouseInputListener = new MouseInputHandler(null, null, null); keyListener = createKeyListener(); selectionModelPropertyChangeListener = createSelectionModelPropertyChangeListener(); componentListener = createComponentListener(); cellEditorListener = createCellEditorListener(); treeExpansionListener = createTreeExpansionListener(); treeModelListener = createTreeModelListener(); editingRow = -1; lastSelectedRow = -1; leafIcon = UIManager.getIcon("Tree.leafIcon"); } |
leafIcon = UIManager.getIcon("Tree.leafIcon"); | public BasicTreeUI() { validCachedPreferredSize = false; drawingCache = new Hashtable(); nodeDimensions = createNodeDimensions(); configureLayoutCache(); propertyChangeListener = createPropertyChangeListener(); focusListener = createFocusListener(); treeSelectionListener = createTreeSelectionListener(); mouseInputListener = new MouseInputHandler(null, null, null); keyListener = createKeyListener(); selectionModelPropertyChangeListener = createSelectionModelPropertyChangeListener(); componentListener = createComponentListener(); cellEditorListener = createCellEditorListener(); treeExpansionListener = createTreeExpansionListener(); treeModelListener = createTreeModelListener(); editingRow = -1; lastSelectedRow = -1; leafIcon = UIManager.getIcon("Tree.leafIcon"); } |
|
return new Rectangle(x, y, SwingUtilities.computeStringWidth(fm, s) + gap, | return new Rectangle(x, y, SwingUtilities.computeStringWidth(fm, s), | Rectangle getCellBounds(int x, int y, Object cell) { if (cell != null) { String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetrics(f); if (s != null) return new Rectangle(x, y, SwingUtilities.computeStringWidth(fm, s) + gap, fm.getHeight()); } return new Rectangle(x, y, 0, 0); } |
return UIManager.getLookAndFeelDefaults().getIcon("Tree.expandedIcon"); return UIManager.getLookAndFeelDefaults().getIcon("Tree.collapsedIcon"); | return expandedIcon; return collapsedIcon; | Icon getCurrentControlIcon(TreePath path) { if (tree.isExpanded(path)) return UIManager.getLookAndFeelDefaults().getIcon("Tree.expandedIcon"); return UIManager.getLookAndFeelDefaults().getIcon("Tree.collapsedIcon"); } |
if (UIManager.getLookAndFeelDefaults().getIcon("Tree.expandedIcon") != null || UIManager.getLookAndFeelDefaults().getIcon("Tree.collapsedIcon") != null) | if (expandedIcon != null || collapsedIcon != null) | boolean hasControlIcons() { if (UIManager.getLookAndFeelDefaults().getIcon("Tree.expandedIcon") != null || UIManager.getLookAndFeelDefaults().getIcon("Tree.collapsedIcon") != null) return true; return false; } |
setExpandedIcon(UIManager.getIcon("Tree.openIcon")); setCollapsedIcon(UIManager.getIcon("Tree.closedIcon")); | setExpandedIcon(UIManager.getIcon("Tree.expandedIcon")); setCollapsedIcon(UIManager.getIcon("Tree.collapsedIcon")); | protected void installDefaults() { LookAndFeel.installColorsAndFont(tree, "Tree.background", "Tree.foreground", "Tree.font"); tree.setOpaque(true); rightChildIndent = UIManager.getInt("Tree.rightChildIndent"); leftChildIndent = UIManager.getInt("Tree.leftChildIndent"); setRowHeight(UIManager.getInt("Tree.rowHeight")); tree.requestFocusInWindow(false); tree.setScrollsOnExpand(UIManager.getBoolean("Tree.scrollsOnExpand")); setExpandedIcon(UIManager.getIcon("Tree.openIcon")); setCollapsedIcon(UIManager.getIcon("Tree.closedIcon")); } |
tree.addMouseListener(mouseInputListener); | tree.addMouseListener(mouseListener); | protected void installListeners() { tree.addPropertyChangeListener(propertyChangeListener); tree.addFocusListener(focusListener); tree.addTreeSelectionListener(treeSelectionListener); tree.addMouseListener(mouseInputListener); tree.addKeyListener(keyListener); tree.addPropertyChangeListener(selectionModelPropertyChangeListener); tree.addComponentListener(componentListener); tree.addTreeExpansionListener(treeExpansionListener); if (treeModel != null) treeModel.addTreeModelListener(treeModelListener); } |
installKeyboardActions(); installListeners(); | public void installUI(JComponent c) { tree = (JTree) c; prepareForUIInstall(); super.installUI(c); installDefaults(); installComponents(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; TreeModel mod = tree.getModel(); setModel(mod); if (mod != null) { TreePath path = new TreePath(mod.getRoot()); if (!tree.isExpanded(path)) toggleExpandState(path); } treeSelectionModel = tree.getSelectionModel(); installKeyboardActions(); installListeners(); completeUIInstall(); } |
|
if (bounds == null) | protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; int row = getRowForPath(tree, path); if (!isLeaf(row)) { if (bounds == null) bounds = getPathBounds(tree, path); if (hasControlIcons() && (mouseX < bounds.x) && (mouseX > (bounds.x - getCurrentControlIcon(path).getIconWidth()))) cntlClick = true; } return cntlClick; } |
|
&& (mouseX > (bounds.x - getCurrentControlIcon(path).getIconWidth()))) | && (mouseX > (bounds.x - getCurrentControlIcon(path).getIconWidth() - gap))) | protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; int row = getRowForPath(tree, path); if (!isLeaf(row)) { if (bounds == null) bounds = getPathBounds(tree, path); if (hasControlIcons() && (mouseX < bounds.x) && (mouseX > (bounds.x - getCurrentControlIcon(path).getIconWidth()))) cntlClick = true; } return cntlClick; } |
paintControlIcons(g, 0, 0, 0, 0, tree, treeModel, root); | paintControlIcons(g, 0, 0, 0, tree, treeModel, root); | public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; if (treeModel != null) { Object root = treeModel.getRoot(); paintRecursive(g, 0, 0, 0, tree, treeModel, root); if (hasControlIcons()) paintControlIcons(g, 0, 0, 0, 0, tree, treeModel, root); } } |
int childNumber, int depth, JTree tree, TreeModel mod, | int depth, JTree tree, TreeModel mod, | int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrentControlIcon(path); Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; if (mod.isLeaf(node)) descent += rowHeight; else { if (depth > 0 || tree.isRootVisible()) descent += rowHeight; int max = 0; if (!mod.isLeaf(node)) max = mod.getChildCount(node); if (!node.equals(mod.getRoot()) && (tree.isRootVisible() || getLevel(node) != 1)) icon.paintIcon(tree, g, indentation - rightChildIndent - 3, h); if (tree.isExpanded(path)) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (depth == 0 && !tree.isRootVisible()) indent = 1; descent = paintControlIcons(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(node, i)); } } } return descent; } |
int h = descent; | int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrentControlIcon(path); Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; if (mod.isLeaf(node)) descent += rowHeight; else { if (depth > 0 || tree.isRootVisible()) descent += rowHeight; int max = 0; if (!mod.isLeaf(node)) max = mod.getChildCount(node); if (!node.equals(mod.getRoot()) && (tree.isRootVisible() || getLevel(node) != 1)) icon.paintIcon(tree, g, indentation - rightChildIndent - 3, h); if (tree.isExpanded(path)) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (depth == 0 && !tree.isRootVisible()) indent = 1; descent = paintControlIcons(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(node, i)); } } } return descent; } |
|
if (!node.equals(mod.getRoot()) && (tree.isRootVisible() || getLevel(node) != 1)) icon.paintIcon(tree, g, indentation - rightChildIndent - 3, h); if (tree.isExpanded(path)) { | int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrentControlIcon(path); Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; if (mod.isLeaf(node)) descent += rowHeight; else { if (depth > 0 || tree.isRootVisible()) descent += rowHeight; int max = 0; if (!mod.isLeaf(node)) max = mod.getChildCount(node); if (!node.equals(mod.getRoot()) && (tree.isRootVisible() || getLevel(node) != 1)) icon.paintIcon(tree, g, indentation - rightChildIndent - 3, h); if (tree.isExpanded(path)) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (depth == 0 && !tree.isRootVisible()) indent = 1; descent = paintControlIcons(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(node, i)); } } } return descent; } |
|
descent = paintControlIcons(g, indent, descent, i, depth + 1, | descent = paintControlIcons(g, indent, descent, depth + 1, | int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrentControlIcon(path); Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; if (mod.isLeaf(node)) descent += rowHeight; else { if (depth > 0 || tree.isRootVisible()) descent += rowHeight; int max = 0; if (!mod.isLeaf(node)) max = mod.getChildCount(node); if (!node.equals(mod.getRoot()) && (tree.isRootVisible() || getLevel(node) != 1)) icon.paintIcon(tree, g, indentation - rightChildIndent - 3, h); if (tree.isExpanded(path)) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (depth == 0 && !tree.isRootVisible()) indent = 1; descent = paintControlIcons(g, indent, descent, i, depth + 1, tree, mod, mod.getChild(node, i)); } } } return descent; } |
paintControlIcons(g, 0, 0, 0, 0, tree, treeModel, path.getLastPathComponent()); | paintControlIcons(g, 0, 0, 0, tree, treeModel, path.getLastPathComponent()); | protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { if (treeModel != null && hasControlIcons()) paintControlIcons(g, 0, 0, 0, 0, tree, treeModel, path.getLastPathComponent()); } |
int iconWidth = 0; if (!isLeaf && hasControlIcons()) iconWidth += getCurrentControlIcon(path).getIconWidth(); bounds.width += bounds.x + iconWidth + gap; | int paintRecursive(Graphics g, int indentation, int descent, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; TreePath path = new TreePath(getPathToRoot(curr, 0)); int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; int heightOfLine = descent + halfHeight; int row = getRowForPath(tree, path); boolean isRootVisible = tree.isRootVisible(); boolean isExpanded = tree.isExpanded(path); boolean isLeaf = mod.isLeaf(curr); Rectangle bounds = getPathBounds(tree, path); Object root = mod.getRoot(); int iconWidth = 0; if (!isLeaf && hasControlIcons()) iconWidth += getCurrentControlIcon(path).getIconWidth(); bounds.width += bounds.x + iconWidth + gap; if (isLeaf) { paintRow(g, clip, null, bounds, path, row, true, false, true); descent += getRowHeight(); } else { if (depth > 0 || isRootVisible) { paintRow(g, clip, null, bounds, path, row, isExpanded, false, false); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); if (isExpanded) { for (int i = 0; i < max; i++) { int indent = indentation + rightChildIndent; if (!isRootVisible && depth == 0) indent = 0; else if (isRootVisible || (!isRootVisible && !curr.equals(root))) { g.setColor(getHashColor()); heightOfLine = descent + halfHeight; paintHorizontalLine(g, (JComponent) tree, heightOfLine, indentation + halfWidth, indentation + rightChildIndent); } descent = paintRecursive(g, indent, descent, depth + 1, tree, mod, mod.getChild(curr, i)); } } } if (isExpanded) if (y0 != heightOfLine && !isLeaf && mod.getChildCount(curr) > 0) { g.setColor(getHashColor()); paintVerticalLine(g, (JComponent) tree, indentation + halfWidth, y0, heightOfLine); } return descent; } |
|
bounds.x += gap; | protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasIcons = false; Object node = path.getLastPathComponent(); if (tree.isVisible(path)) { if (editingComponent != null && editingPath != null && isEditing(tree) && node.equals(editingPath.getLastPathComponent())) { rendererPane.paintComponent(g, editingComponent.getParent(), null, bounds); } else { TreeCellRenderer dtcr = tree.getCellRenderer(); if (dtcr == null) dtcr = createDefaultCellRenderer(); Component c = dtcr.getTreeCellRendererComponent(tree, node, selected, isExpanded, isLeaf, row, false); bounds.x += gap; rendererPane.paintComponent(g, c, c.getParent(), bounds); } } } |
|
tree.removeMouseListener(mouseInputListener); | tree.removeMouseListener(mouseListener); | protected void uninstallListeners() { tree.removePropertyChangeListener(propertyChangeListener); tree.removeFocusListener(focusListener); tree.removeTreeSelectionListener(treeSelectionListener); tree.removeMouseListener(mouseInputListener); tree.removeKeyListener(keyListener); tree.removePropertyChangeListener(selectionModelPropertyChangeListener); tree.removeComponentListener(componentListener); tree.removeTreeExpansionListener(treeExpansionListener); TreeCellEditor tce = tree.getCellEditor(); if (tce != null) tce.removeCellEditorListener(cellEditorListener); if (treeModel != null) treeModel.removeTreeModelListener(treeModelListener); } |
if (current != null) current = current.pathByAddingChild(next); else | if (current == null) | void updateCurrentVisiblePath() { Object next = treeModel.getRoot(); Rectangle bounds = getCellBounds(0, 0, next); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() && tree.isExpanded(new TreePath(next)))) next = getNextNode(next); TreePath current = null; while (next != null) { if (current != null) current = current.pathByAddingChild(next); else current = new TreePath(next); // FIXME: Inefficent to have 2 loops when the // tree is very large. Find a better way. do next = getNextNode(next); while (next != null && !tree.isVisible(new TreePath(getPathToRoot(next, 0)))); } currentVisiblePath = current; } |
else current = current.pathByAddingChild(next); | void updateCurrentVisiblePath() { Object next = treeModel.getRoot(); Rectangle bounds = getCellBounds(0, 0, next); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() && tree.isExpanded(new TreePath(next)))) next = getNextNode(next); TreePath current = null; while (next != null) { if (current != null) current = current.pathByAddingChild(next); else current = new TreePath(next); // FIXME: Inefficent to have 2 loops when the // tree is very large. Find a better way. do next = getNextNode(next); while (next != null && !tree.isVisible(new TreePath(getPathToRoot(next, 0)))); } currentVisiblePath = current; } |
|
tree.setVisibleRowCount(getRowCount(tree)); if (tree.getSelectionModel() != null && tree.getSelectionCount() == 0 && currentVisiblePath != null) tree.addSelectionRow(0); | void updateCurrentVisiblePath() { Object next = treeModel.getRoot(); Rectangle bounds = getCellBounds(0, 0, next); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() && tree.isExpanded(new TreePath(next)))) next = getNextNode(next); TreePath current = null; while (next != null) { if (current != null) current = current.pathByAddingChild(next); else current = new TreePath(next); // FIXME: Inefficent to have 2 loops when the // tree is very large. Find a better way. do next = getNextNode(next); while (next != null && !tree.isVisible(new TreePath(getPathToRoot(next, 0)))); } currentVisiblePath = current; } |
|
mapper.saveKeyMap(); mapper.fireKeyChangeEvent(); | KeyMapper.saveKeyMap(); KeyMapper.fireKeyChangeEvent(); | public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("DONE")) { if (mods) { mapper.saveKeyMap(); mapper.fireKeyChangeEvent(); } setVisible(false); } if (e.getActionCommand().equals("MAP")) { mapIt(); } if (e.getActionCommand().equals("REMOVE")) { removeIt(); } if (e.getActionCommand().equals("MAP-Prime")) { altKey = false; mapIt(); } if (e.getActionCommand().equals("REMOVE-Prime")) { altKey = false; removeIt(); } if (e.getActionCommand().equals("MAP-Alt")) { altKey = true; mapIt(); } if (e.getActionCommand().equals("REMOVE-Alt")) { altKey = true; removeIt(); } } |
desc = mapper.getKeyStrokeMnemonic(ke,isAltGr); | desc = KeyMapper.getKeyStrokeMnemonic(ke,isAltGr); | private String getKeyDescription(KeyEvent ke) { String desc; if (isLinux) desc = mapper.getKeyStrokeMnemonic(ke,isAltGr); else desc = mapper.getKeyStrokeMnemonic(ke,isAltGr); if (desc != null && desc.length() > 1 && desc.startsWith("[")) desc = LangTool.getString("key."+ desc); return desc; } |
if (mapper.isKeyStrokeDefined(keyDesc)) { | if (KeyMapper.isKeyStrokeDefined(keyDesc)) { | private String getLocationDesc(String keyDesc) { String locStr = LangTool.getString("key.labelLocUnknown"); if (mapper.isKeyStrokeDefined(keyDesc)) { switch (mapper.getKeyStroker(keyDesc).getLocation()) { case KeyStroker.KEY_LOCATION_LEFT: locStr = LangTool.getString("key.labelLocLeft"); break; case KeyStroker.KEY_LOCATION_RIGHT: locStr = LangTool.getString("key.labelLocRight"); break; case KeyStroker.KEY_LOCATION_STANDARD: locStr = LangTool.getString("key.labelLocStandard"); break; case KeyStroker.KEY_LOCATION_NUMPAD: locStr = LangTool.getString("key.labelLocNumPad"); break; } } return locStr; } |
switch (mapper.getKeyStroker(keyDesc).getLocation()) { | switch (KeyMapper.getKeyStroker(keyDesc).getLocation()) { | private String getLocationDesc(String keyDesc) { String locStr = LangTool.getString("key.labelLocUnknown"); if (mapper.isKeyStrokeDefined(keyDesc)) { switch (mapper.getKeyStroker(keyDesc).getLocation()) { case KeyStroker.KEY_LOCATION_LEFT: locStr = LangTool.getString("key.labelLocLeft"); break; case KeyStroker.KEY_LOCATION_RIGHT: locStr = LangTool.getString("key.labelLocRight"); break; case KeyStroker.KEY_LOCATION_STANDARD: locStr = LangTool.getString("key.labelLocStandard"); break; case KeyStroker.KEY_LOCATION_NUMPAD: locStr = LangTool.getString("key.labelLocNumPad"); break; } } return locStr; } |
exists = mapper.isKeyStrokeDefined(ke,isAltGr); | exists = KeyMapper.isKeyStrokeDefined(ke,isAltGr); | private boolean isAvailable(KeyEvent ke) { boolean exists = true; if (isLinux) { exists = mapper.isKeyStrokeDefined(ke,isAltGr); } else { exists = mapper.isKeyStrokeDefined(ke); } if (exists) { Object[] args = {getKeyDescription(ke)}; int result = JOptionPane.showConfirmDialog(this, LangTool.messageFormat("messages.mapKeyWarning",args), LangTool.getString("key.labelKeyExists"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (result == JOptionPane.YES_OPTION) return true; else return false; } return !exists; } |
exists = mapper.isKeyStrokeDefined(ke); | exists = KeyMapper.isKeyStrokeDefined(ke); | private boolean isAvailable(KeyEvent ke) { boolean exists = true; if (isLinux) { exists = mapper.isKeyStrokeDefined(ke,isAltGr); } else { exists = mapper.isKeyStrokeDefined(ke); } if (exists) { Object[] args = {getKeyDescription(ke)}; int result = JOptionPane.showConfirmDialog(this, LangTool.messageFormat("messages.mapKeyWarning",args), LangTool.getString("key.labelKeyExists"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (result == JOptionPane.YES_OPTION) return true; else return false; } return !exists; } |
mapper.init(); | KeyMapper.init(); | void jbInit() throws Exception { // create some reusable borders and layouts BorderLayout borderLayout = new BorderLayout(); mapper = new KeyMapper(); mapper.init(); keyPanel.setLayout(borderLayout); keyPanel.add(createFunctionsPanel(),BorderLayout.WEST); keyPanel.add(createMappingPanel(),BorderLayout.CENTER); // add the panels to our dialog getContentPane().add(keyPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // add option buttons to options panel addOptButton(LangTool.getString("key.labelDone","Done"),"DONE",options,true); this.setModal(true); this.setTitle(LangTool.getString("key.title")); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // now show the world what we can do show(); } |
mapper.removeKeyStroke(function); | KeyMapper.removeKeyStroke(function); | private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String function = mnemonicData[index]; if (altKey) function += KeyStroker.altSuffix; mapper.removeKeyStroke(function); setKeyInformation(function); } else { if (macros) { Object o = functions.getSelectedValue(); String name; if (o instanceof Macro) { name = ((Macro)o).getFullName(); } else { name = (String)o; } if (altKey) name += KeyStroker.altSuffix; mapper.removeKeyStroke(name); setKeyInformation(name); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); if (altKey) k += KeyStroker.altSuffix; mapper.removeKeyStroke(k); setKeyInformation(k); } } mods = true; } |
mapper.removeKeyStroke(name); | KeyMapper.removeKeyStroke(name); | private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String function = mnemonicData[index]; if (altKey) function += KeyStroker.altSuffix; mapper.removeKeyStroke(function); setKeyInformation(function); } else { if (macros) { Object o = functions.getSelectedValue(); String name; if (o instanceof Macro) { name = ((Macro)o).getFullName(); } else { name = (String)o; } if (altKey) name += KeyStroker.altSuffix; mapper.removeKeyStroke(name); setKeyInformation(name); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); if (altKey) k += KeyStroker.altSuffix; mapper.removeKeyStroke(k); setKeyInformation(k); } } mods = true; } |
mapper.removeKeyStroke(k); | KeyMapper.removeKeyStroke(k); | private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String function = mnemonicData[index]; if (altKey) function += KeyStroker.altSuffix; mapper.removeKeyStroke(function); setKeyInformation(function); } else { if (macros) { Object o = functions.getSelectedValue(); String name; if (o instanceof Macro) { name = ((Macro)o).getFullName(); } else { name = (String)o; } if (altKey) name += KeyStroker.altSuffix; mapper.removeKeyStroke(name); setKeyInformation(name); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); if (altKey) k += KeyStroker.altSuffix; mapper.removeKeyStroke(k); setKeyInformation(k); } } mods = true; } |
strokeDesc.setText(mapper.getKeyStrokeDesc(keyDesc)); strokeDescAlt.setText(mapper.getKeyStrokeDesc(keyDesc + | strokeDesc.setText(KeyMapper.getKeyStrokeDesc(keyDesc)); strokeDescAlt.setText(KeyMapper.getKeyStrokeDesc(keyDesc + | private void setKeyInformation(String keyDesc) { if (keyDesc.endsWith(KeyStroker.altSuffix)) { keyDesc = keyDesc.substring(0,keyDesc.indexOf(KeyStroker.altSuffix)); } strokeDesc.setText(mapper.getKeyStrokeDesc(keyDesc)); strokeDescAlt.setText(mapper.getKeyStrokeDesc(keyDesc + KeyStroker.altSuffix)); strokeLocation.setText(getLocationDesc(keyDesc)); strokeLocationAlt.setText(getLocationDesc(keyDesc + KeyStroker.altSuffix)); } |
mapper.setKeyStroke(stroke,ke,isAltGr); | KeyMapper.setKeyStroke(stroke,ke,isAltGr); | private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String stroke = mnemonicData[index]; if (altKey) stroke += KeyStroker.altSuffix; if (isLinux) { mapper.setKeyStroke(stroke,ke,isAltGr); } else { mapper.setKeyStroke(stroke,ke); } setKeyInformation(stroke); } else { if (macros) { Object o = functions.getSelectedValue(); String macro; if (o instanceof Macro) macro = ((Macro)o).getFullName(); else macro = (String)o; if (altKey) macro += KeyStroker.altSuffix; System.out.println(macro); if (isLinux) mapper.setKeyStroke(macro,ke,isAltGr); else mapper.setKeyStroke(macro,ke); setKeyInformation(macro); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = parseSpecialCharacter((String)functions.getSelectedValue()); if (altKey) k += KeyStroker.altSuffix; mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } setKeyInformation(k); } } mods = true; } |
mapper.setKeyStroke(stroke,ke); | KeyMapper.setKeyStroke(stroke,ke); | private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String stroke = mnemonicData[index]; if (altKey) stroke += KeyStroker.altSuffix; if (isLinux) { mapper.setKeyStroke(stroke,ke,isAltGr); } else { mapper.setKeyStroke(stroke,ke); } setKeyInformation(stroke); } else { if (macros) { Object o = functions.getSelectedValue(); String macro; if (o instanceof Macro) macro = ((Macro)o).getFullName(); else macro = (String)o; if (altKey) macro += KeyStroker.altSuffix; System.out.println(macro); if (isLinux) mapper.setKeyStroke(macro,ke,isAltGr); else mapper.setKeyStroke(macro,ke); setKeyInformation(macro); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = parseSpecialCharacter((String)functions.getSelectedValue()); if (altKey) k += KeyStroker.altSuffix; mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } setKeyInformation(k); } } mods = true; } |
mapper.setKeyStroke(macro,ke,isAltGr); | KeyMapper.setKeyStroke(macro,ke,isAltGr); | private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String stroke = mnemonicData[index]; if (altKey) stroke += KeyStroker.altSuffix; if (isLinux) { mapper.setKeyStroke(stroke,ke,isAltGr); } else { mapper.setKeyStroke(stroke,ke); } setKeyInformation(stroke); } else { if (macros) { Object o = functions.getSelectedValue(); String macro; if (o instanceof Macro) macro = ((Macro)o).getFullName(); else macro = (String)o; if (altKey) macro += KeyStroker.altSuffix; System.out.println(macro); if (isLinux) mapper.setKeyStroke(macro,ke,isAltGr); else mapper.setKeyStroke(macro,ke); setKeyInformation(macro); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = parseSpecialCharacter((String)functions.getSelectedValue()); if (altKey) k += KeyStroker.altSuffix; mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } setKeyInformation(k); } } mods = true; } |
mapper.setKeyStroke(macro,ke); | KeyMapper.setKeyStroke(macro,ke); | private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String stroke = mnemonicData[index]; if (altKey) stroke += KeyStroker.altSuffix; if (isLinux) { mapper.setKeyStroke(stroke,ke,isAltGr); } else { mapper.setKeyStroke(stroke,ke); } setKeyInformation(stroke); } else { if (macros) { Object o = functions.getSelectedValue(); String macro; if (o instanceof Macro) macro = ((Macro)o).getFullName(); else macro = (String)o; if (altKey) macro += KeyStroker.altSuffix; System.out.println(macro); if (isLinux) mapper.setKeyStroke(macro,ke,isAltGr); else mapper.setKeyStroke(macro,ke); setKeyInformation(macro); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = parseSpecialCharacter((String)functions.getSelectedValue()); if (altKey) k += KeyStroker.altSuffix; mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } setKeyInformation(k); } } mods = true; } |
mapper.removeKeyStroke(k); | KeyMapper.removeKeyStroke(k); | private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String stroke = mnemonicData[index]; if (altKey) stroke += KeyStroker.altSuffix; if (isLinux) { mapper.setKeyStroke(stroke,ke,isAltGr); } else { mapper.setKeyStroke(stroke,ke); } setKeyInformation(stroke); } else { if (macros) { Object o = functions.getSelectedValue(); String macro; if (o instanceof Macro) macro = ((Macro)o).getFullName(); else macro = (String)o; if (altKey) macro += KeyStroker.altSuffix; System.out.println(macro); if (isLinux) mapper.setKeyStroke(macro,ke,isAltGr); else mapper.setKeyStroke(macro,ke); setKeyInformation(macro); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = parseSpecialCharacter((String)functions.getSelectedValue()); if (altKey) k += KeyStroker.altSuffix; mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } setKeyInformation(k); } } mods = true; } |
mapper.setKeyStroke(k,ke,isAltGr); | KeyMapper.setKeyStroke(k,ke,isAltGr); | private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String stroke = mnemonicData[index]; if (altKey) stroke += KeyStroker.altSuffix; if (isLinux) { mapper.setKeyStroke(stroke,ke,isAltGr); } else { mapper.setKeyStroke(stroke,ke); } setKeyInformation(stroke); } else { if (macros) { Object o = functions.getSelectedValue(); String macro; if (o instanceof Macro) macro = ((Macro)o).getFullName(); else macro = (String)o; if (altKey) macro += KeyStroker.altSuffix; System.out.println(macro); if (isLinux) mapper.setKeyStroke(macro,ke,isAltGr); else mapper.setKeyStroke(macro,ke); setKeyInformation(macro); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = parseSpecialCharacter((String)functions.getSelectedValue()); if (altKey) k += KeyStroker.altSuffix; mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } setKeyInformation(k); } } mods = true; } |
mapper.setKeyStroke(k,ke); | KeyMapper.setKeyStroke(k,ke); | private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); String stroke = mnemonicData[index]; if (altKey) stroke += KeyStroker.altSuffix; if (isLinux) { mapper.setKeyStroke(stroke,ke,isAltGr); } else { mapper.setKeyStroke(stroke,ke); } setKeyInformation(stroke); } else { if (macros) { Object o = functions.getSelectedValue(); String macro; if (o instanceof Macro) macro = ((Macro)o).getFullName(); else macro = (String)o; if (altKey) macro += KeyStroker.altSuffix; System.out.println(macro); if (isLinux) mapper.setKeyStroke(macro,ke,isAltGr); else mapper.setKeyStroke(macro,ke); setKeyInformation(macro); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = parseSpecialCharacter((String)functions.getSelectedValue()); if (altKey) k += KeyStroker.altSuffix; mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } setKeyInformation(k); } } mods = true; } |
action = new AbstractAction(LangTool.getString("popup.systemRequest")) { public void actionPerformed(ActionEvent e) { vt.systemRequest(); } }; popup.add(action); action = new AbstractAction(LangTool.getString("popup.help")) { public void actionPerformed(ActionEvent e) { vt.sendHelpRequest(); } }; popup.add(action); | 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(action); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(action); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(action); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(action); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(action); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(action); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(action); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(action); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(action); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(action); | private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()) - (screen.getCols()-1); 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(action); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(false); getFocusForMe(); } }; popup.add(action); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyMe(); getFocusForMe(); } }; popup.add(action); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(false); getFocusForMe(); } }; popup.add(action); 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 , workR.height ); 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.macros")); 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(action); popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.systemRequest")) { public void actionPerformed(ActionEvent e) { vt.systemRequest(); } }; popup.add(action); action = new AbstractAction(LangTool.getString("popup.help")) { public void actionPerformed(ActionEvent e) { vt.sendHelpRequest(); } }; popup.add(action); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; popup.add(action); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); } }; popup.add(action); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; popup.add(action); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); } }; popup.add(action); popup.addSeparator(); JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (recording) { 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(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { macMenu.addSeparator(); String[] macrosList = macros.getMacroList(); for (int x = 0; x < macrosList.length; x++) { action = new AbstractAction(macrosList[x]) { public void actionPerformed(ActionEvent e) { executeMeMacro(e); } }; macMenu.add(action); } } popup.add(macMenu); popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); } }; popup.add(action); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); } }; sendMenu.add(action); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { vt.disconnect(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { vt.connect(); getFocusForMe(); } }; } popup.add(action); } action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(action); popup.show(me.getComponent(), me.getX(),me.getY()); } |
popup.add(action); | kbMenu.add(action); | private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()) - (screen.getCols()-1); 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(action); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(false); getFocusForMe(); } }; popup.add(action); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyMe(); getFocusForMe(); } }; popup.add(action); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(false); getFocusForMe(); } }; popup.add(action); 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 , workR.height ); 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.macros")); 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(action); popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.systemRequest")) { public void actionPerformed(ActionEvent e) { vt.systemRequest(); } }; popup.add(action); action = new AbstractAction(LangTool.getString("popup.help")) { public void actionPerformed(ActionEvent e) { vt.sendHelpRequest(); } }; popup.add(action); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; popup.add(action); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); } }; popup.add(action); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; popup.add(action); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); } }; popup.add(action); popup.addSeparator(); JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (recording) { 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(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { macMenu.addSeparator(); String[] macrosList = macros.getMacroList(); for (int x = 0; x < macrosList.length; x++) { action = new AbstractAction(macrosList[x]) { public void actionPerformed(ActionEvent e) { executeMeMacro(e); } }; macMenu.add(action); } } popup.add(macMenu); popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); } }; popup.add(action); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); } }; sendMenu.add(action); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { vt.disconnect(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { vt.connect(); getFocusForMe(); } }; } popup.add(action); } action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(action); popup.show(me.getComponent(), me.getX(),me.getY()); } |
vt.systemRequest(); | mapMeKeys(); | public void actionPerformed(ActionEvent e) { vt.systemRequest(); } |
vt.sendHelpRequest(); | screen.sendKeys("[attn]"); | public void actionPerformed(ActionEvent e) { vt.sendHelpRequest(); } |
vt.hostPrint(1); | screen.sendKeys("[reset]"); | public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } |
vt.systemRequest('4'); } | screen.sendKeys("[sysreq]"); } | public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } |
showHexMap(); } | vt.systemRequest('4'); } | public void actionPerformed(ActionEvent e) { showHexMap(); } |
mapMeKeys(); | screen.sendKeys("[dupfield]"); | public void actionPerformed(ActionEvent e) { mapMeKeys(); } |
doAttributes(); | screen.sendKeys("[help]"); | public void actionPerformed(ActionEvent e) { doAttributes(); } |
stopRecordingMe(); getFocusForMe(); } | screen.sendKeys("[eraseeof]"); } | public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } |
startRecordingMe(); } | screen.sendKeys("[field+]"); } | public void actionPerformed(ActionEvent e) { startRecordingMe(); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.