rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
byte[] blockData = fs.getBlock( fs.getSuperblock().getFirstDataBlock() + 1); byte[] data = new byte[GROUPDESCRIPTOR_LENGTH]; System.arraycopy(blockData, 0, data, 0, GROUPDESCRIPTOR_LENGTH); | long baseBlock = fs.getSuperblock().getFirstDataBlock()+1; long blockOffset=(groupNr*GROUPDESCRIPTOR_LENGTH)/fs.getBlockSize(); long offset =(groupNr*GROUPDESCRIPTOR_LENGTH)%fs.getBlockSize(); byte[] blockData= fs.getBlock(baseBlock + blockOffset); data = new byte[GROUPDESCRIPTOR_LENGTH]; System.arraycopy(blockData, (int)offset, data, 0, GROUPDESCRIPTOR_LENGTH); | public GroupDescriptor(int groupNr, Ext2FileSystem fs) throws IOException{ //read the group descriptors from the main copy in block group 0 byte[] blockData = fs.getBlock( fs.getSuperblock().getFirstDataBlock() + 1); byte[] data = new byte[GROUPDESCRIPTOR_LENGTH]; System.arraycopy(blockData, 0, data, 0, GROUPDESCRIPTOR_LENGTH); this.groupNr = groupNr; this.fs = fs; setDirty(false); log.setLevel(Level.DEBUG); } |
cdrBufInput in = new cdrBufInput(out.buffer.toByteArray()); in.setOrb(orb); return in; | cdrBufInput in = new cdrBufInput(out.buffer.toByteArray()); in.setOrb(orb); return in; } | public org.omg.CORBA.portable.InputStream create_input_stream() { if (has instanceof universalHolder) { universalHolder u = (universalHolder) has; return u.getInputStream(); } else { cdrBufOutput out = new cdrBufOutput(); out.setOrb(orb); write_value(out); cdrBufInput in = new cdrBufInput(out.buffer.toByteArray()); in.setOrb(orb); return in; } } |
} | public org.omg.CORBA.portable.InputStream create_input_stream() { if (has instanceof universalHolder) { universalHolder u = (universalHolder) has; return u.getInputStream(); } else { cdrBufOutput out = new cdrBufOutput(); out.setOrb(orb); write_value(out); cdrBufInput in = new cdrBufInput(out.buffer.toByteArray()); in.setOrb(orb); return in; } } |
|
{ type(typecode); insert_Value(x); | { type(typecode); insert_Value(x); } | public void insert_Value(Serializable x, TypeCode c_typecode) { if (typecode != null && typecode.kind() == TCKind.tk_value_box) { has = new gnuValueHolder(x, typecode); } else { type(typecode); insert_Value(x); } } |
} | public void insert_Value(Serializable x, TypeCode c_typecode) { if (typecode != null && typecode.kind() == TCKind.tk_value_box) { has = new gnuValueHolder(x, typecode); } else { type(typecode); insert_Value(x); } } |
|
public ConnectException(String message) | public ConnectException() | public ConnectException(String message) { super(message); } |
super(message); | public ConnectException(String message) { super(message); } |
|
pages.setText(splfile.getIntegerAttribute(splfile.ATTR_PAGES).toString()); | pages.setText(splfile.getIntegerAttribute(SpooledFile.ATTR_PAGES).toString()); | private JPanel pageOne () throws Exception { contentPane = new JPanel(); contentPane.setLayout(new BorderLayout()); statusBar.setText(" "); statusBar.setBorder(BorderFactory.createEtchedBorder()); spoolPanel.setLayout(new BorderLayout()); contentPane.add(spoolPanel, BorderLayout.CENTER); contentPane.add(statusBar, BorderLayout.SOUTH); // create the labels to be used for the spooled file data labelSpooledFile.setText(LangTool.getString("spool.labelSpooledFile")); labelJobName.setText(LangTool.getString("spool.labelJobName")); labelUser.setText(LangTool.getString("spool.labelJobUser")); labelNumber.setText(LangTool.getString("spool.labelJobNumber")); labelFileNumber.setText(LangTool.getString("spool.labelSpoolNumber")); labelSystem.setText(LangTool.getString("spool.labelSystem")); labelPages.setText(LangTool.getString("spool.labelPages")); spoolData.setLayout(new AlignLayout(2,5,5)); spoolData.setBorder(BorderFactory.createTitledBorder( LangTool.getString("spool.labelSpoolInfo"))); // create the data fields to be used for the spooled file data spooledFile.setText(splfile.getName()); jobName.setText(splfile.getJobName()); user.setText(splfile.getJobUser()); spooledFileNumber.setText(Integer.toString(splfile.getNumber())); number.setText(splfile.getJobNumber()); systemName.setText(splfile.getSystem().getSystemName()); pages.setText(splfile.getIntegerAttribute(splfile.ATTR_PAGES).toString()); spoolData.add(labelSystem, null); spoolData.add(systemName, null); spoolData.add(labelSpooledFile, null); spoolData.add(spooledFile, null); spoolData.add(labelJobName, null); spoolData.add(jobName, null); spoolData.add(labelUser, null); spoolData.add(user, null); spoolData.add(labelNumber, null); spoolData.add(number, null); spoolData.add(labelFileNumber, null); spoolData.add(spooledFileNumber, null); spoolData.add(labelPages, null); spoolData.add(pages, null); spoolPanel.add(spoolOptions, BorderLayout.SOUTH); // set the spool export panel spoolPanel.add(spoolData, BorderLayout.CENTER); spoolOptions.setLayout(new BorderLayout()); JPanel spoolInfo = new JPanel(); AlignLayout alignMe2 = new AlignLayout(3,5,5); spoolInfo.setLayout(alignMe2); spoolInfo.setBorder(BorderFactory.createTitledBorder( LangTool.getString("spool.labelExportInfo"))); cvtType = new JComboBox(); cvtType.addItem(LangTool.getString("spool.toPDF")); cvtType.addItem(LangTool.getString("spool.toText"));// cvtType.addItemListener(new java.awt.event.ItemListener() {// public void itemStateChanged(ItemEvent e) {// // if (((String)cvtType.getSelectedItem()).equals(// // LangTool.getString("spool.toText"))) {// // twoText.setVisible(true);// // twoPDF.setVisible(false);// // }// // else {// // twoText.setVisible(false);// // twoPDF.setVisible(true);// // }// }// }); spoolInfo.add(new JLabel(LangTool.getString("spool.labelFormat"))); spoolInfo.add(cvtType); spoolInfo.add(new JLabel("")); pc = new JRadioButton(LangTool.getString("spool.labelPCPath")); pcPathInfo = new JTextField(30); pcSave = new JButton("..."); pcSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { getPCFile(); } }); spoolInfo.add(pc); spoolInfo.add(pcPathInfo); spoolInfo.add(pcSave); ifs = new JRadioButton(LangTool.getString("spool.labelIFSPath")); ifsPathInfo = new JTextField(30); ifsSave = new JButton("..."); ifsSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { getIFSFile(); } }); spoolInfo.add(ifs); spoolInfo.add(ifsPathInfo); spoolInfo.add(ifsSave); email = new JRadioButton(LangTool.getString("spool.labelEmail")); spoolInfo.add(email); spoolInfo.add(new JLabel("")); spoolInfo.add(new JLabel("")); ButtonGroup bg = new ButtonGroup(); bg.add(pc); bg.add(ifs); bg.add(email); pc.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { doItemStateChanged(e); } }); ifs.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { doItemStateChanged(e); } }); email.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { doItemStateChanged(e); } }); pc.setSelected(true); spoolOptions.add(spoolInfo,BorderLayout.CENTER); return contentPane; } |
background = UIManager.getColor(prefix + ".background"); | protected void installDefaults() { Caret caret = textComponent.getCaret(); if (caret == null) { caret = createCaret(); textComponent.setCaret(caret); } Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null) textComponent.setHighlighter(createHighlighter()); String prefix = getPropertyPrefix(); LookAndFeel.installColorsAndFont(textComponent, prefix + ".background", prefix + ".foreground", prefix + ".font"); LookAndFeel.installBorder(textComponent, prefix + ".border"); textComponent.setMargin(UIManager.getInsets(prefix + ".margin")); caret.setBlinkRate(UIManager.getInt(prefix + ".caretBlinkRate")); // Fetch the colors for enabled/disabled text components. inactiveBackground = UIManager.getColor(prefix + ".inactiveBackground"); textComponent.setDisabledTextColor (UIManager.getColor(prefix + ".inactiveForeground")); textComponent.setSelectedTextColor(UIManager.getColor(prefix + ".selectionForeground")); } |
|
return null; | return new DefaultKeySelectionManager(); | protected KeySelectionManager createDefaultKeySelectionManager() { return null; } |
return null; | return keySelectionManager; | public KeySelectionManager getKeySelectionManager() { return null; } |
else if (keySelectionManager != null) { int i = keySelectionManager.selectionForKey(e.getKeyChar(), getModel()); if (i >= 0) setSelectedIndex(i); else super.processKeyEvent(e); } | public void processKeyEvent(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_TAB) setPopupVisible(false); else if (keySelectionManager != null) { int i = keySelectionManager.selectionForKey(e.getKeyChar(), getModel()); if (i >= 0) setSelectedIndex(i); else super.processKeyEvent(e); } else super.processKeyEvent(e); } |
|
fireActionEvent(); | public void setSelectedItem(Object item) { dataModel.setSelectedItem(item); } |
|
bad.minor = Minor.Any; | public static BindingType extract(Any any) { try { return ((BindingTypeHolder) any.extract_Streamable()).value; } catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION("Binding type expected"); bad.initCause(ex); throw bad; } } |
|
keyHandler.sessionClosed((Session)this); keyHandler = null; | public void closeDown() { sesConfig.saveSessionProps(getParent()); // Let's stop the cursor blinking as well as it seems to be causing problems if (screen.isBlinkCursor()) { screen.setBlinkCursorStop(); } vt.disconnect(); } |
|
if (width < 0 || miterlimit < 1.0f || cap < CAP_BUTT || cap > CAP_SQUARE || join < JOIN_MITER || join > JOIN_BEVEL) throw new IllegalArgumentException(); | if (width < 0.0f ) throw new IllegalArgumentException("width " + width + " < 0"); else if (cap < CAP_BUTT || cap > CAP_SQUARE) throw new IllegalArgumentException("cap " + cap + " out of range [" + CAP_BUTT + ".." + CAP_SQUARE + "]"); else if (miterlimit < 1.0f && join == JOIN_MITER) throw new IllegalArgumentException("miterlimit " + miterlimit + " < 1.0f while join == JOIN_MITER"); else if (join < JOIN_MITER || join > JOIN_BEVEL) throw new IllegalArgumentException("join " + join + " out of range [" + JOIN_MITER + ".." + JOIN_BEVEL + "]"); else if (dashPhase < 0.0f && dash != null) throw new IllegalArgumentException("dashPhase " + dashPhase + " < 0.0f while dash != null"); else if (dash != null) if (dash.length == 0) throw new IllegalArgumentException("dash.length is 0"); else { boolean allZero = true; for ( int i = 0; i < dash.length; ++i) { if (dash[i] != 0.0f) { allZero = false; break; } } if (allZero) throw new IllegalArgumentException("all dashes are 0.0f"); } | public BasicStroke(float width, int cap, int join, float miterlimit, float[] dash, float dashPhase) { if (width < 0 || miterlimit < 1.0f || cap < CAP_BUTT || cap > CAP_SQUARE || join < JOIN_MITER || join > JOIN_BEVEL) throw new IllegalArgumentException(); this.width = width; this.cap = cap; this.join = join; limit = miterlimit; this.dash = dash == null ? null : (float[]) dash.clone(); phase = dashPhase; } |
return Toolkit.getDefaultToolkit () | DragGestureRecognizer dgr; dgr = Toolkit.getDefaultToolkit () | createDragGestureRecognizer(Class recognizer, Component c, int actions, DragGestureListener dgl) { return Toolkit.getDefaultToolkit () .createDragGestureRecognizer (recognizer, this, c, actions, dgl); } |
if (dgr == null) dgr = new NoDragGestureRecognizer(this, c, actions, dgl); return dgr; | createDragGestureRecognizer(Class recognizer, Component c, int actions, DragGestureListener dgl) { return Toolkit.getDefaultToolkit () .createDragGestureRecognizer (recognizer, this, c, actions, dgl); } |
|
return null; | return new DragSource(); | public static DragSource getDefaultDragSource() { return null; } |
if (defaultFlavorMap == null) defaultFlavorMap = new SystemFlavorMap (); | ClassLoader classLoader = Thread.currentThread() .getContextClassLoader(); | public static FlavorMap getDefaultFlavorMap () { if (defaultFlavorMap == null) defaultFlavorMap = new SystemFlavorMap (); return defaultFlavorMap; } |
return defaultFlavorMap; | if (classLoader == null) { classLoader = ClassLoader.getSystemClassLoader(); } synchronized(systemFlavorMaps) { FlavorMap map = (FlavorMap) systemFlavorMaps.get(classLoader); if (map == null) { map = new SystemFlavorMap(); systemFlavorMaps.put(classLoader, map); } return map; } | public static FlavorMap getDefaultFlavorMap () { if (defaultFlavorMap == null) defaultFlavorMap = new SystemFlavorMap (); return defaultFlavorMap; } |
changeButtonOrientation(); positionButtons(); | Insets insets = getInsets(); if (orientation == JSplitPane.HORIZONTAL_SPLIT) { int size = getWidth() - insets.left - insets.right; size = Math.max(size, 0); size = Math.min(size, ONE_TOUCH_SIZE); int x, y; if (centerOneTouchButtons) { y = insets.top; x = (getWidth() - size) / 2; } else { x = insets.left; y = 0; } leftButton.setBounds(x, y + ONE_TOUCH_OFFSET, size, size * 2); rightButton.setBounds(x, y + ONE_TOUCH_OFFSET + ONE_TOUCH_SIZE * 2, size, size * 2); } else { int size = getHeight() - insets.top - insets.bottom; size = Math.max(size, 0); size = Math.min(size, ONE_TOUCH_SIZE); int x, y; if (centerOneTouchButtons) { x = insets.left; y = (getHeight() - size) / 2; } else { x = 0; y = insets.top; } leftButton.setBounds(x + ONE_TOUCH_OFFSET, y, size * 2, size); rightButton.setBounds(x + ONE_TOUCH_OFFSET + ONE_TOUCH_SIZE * 2, y, size * 2, size); } } else { leftButton.setBounds(-5, -5, 1, 1); rightButton.setBounds(-5, -5, 1, 1); } | public void layoutContainer(Container c) { if (splitPane.isOneTouchExpandable()) { changeButtonOrientation(); positionButtons(); } } |
if (splitPane.isOneTouchExpandable()) { if (e.getSource() == leftButton) { currentDividerLocation--; if (currentDividerLocation < 0) currentDividerLocation = 0; moveDividerTo(currentDividerLocation); return; } else if (e.getSource() == rightButton) { currentDividerLocation++; if (currentDividerLocation > 2) currentDividerLocation = 2; moveDividerTo(currentDividerLocation); return; } } | public void mousePressed(MouseEvent e) { if (splitPane.isOneTouchExpandable()) { if (e.getSource() == leftButton) { currentDividerLocation--; if (currentDividerLocation < 0) currentDividerLocation = 0; moveDividerTo(currentDividerLocation); return; } else if (e.getSource() == rightButton) { currentDividerLocation++; if (currentDividerLocation > 2) currentDividerLocation = 2; moveDividerTo(currentDividerLocation); return; } } isDragging = true; currentDividerLocation = 1; if (orientation == JSplitPane.HORIZONTAL_SPLIT) dragger = new DragController(e); else dragger = new VerticalDragController(e); prepareForDragging(); } |
|
centerOneTouchButtons = UIManager.getBoolean("SplitPane.centerOneTouchButtons"); | public BasicSplitPaneDivider(BasicSplitPaneUI ui) { setLayout(new DividerLayout()); setBasicSplitPaneUI(ui); setDividerSize(splitPane.getDividerSize()); } |
|
int dir = SwingConstants.WEST; if (orientation == JSplitPane.VERTICAL_SPLIT) dir = SwingConstants.NORTH; JButton button = new BasicArrowButton(dir); button.setBorder(null); | JButton button = new BasicOneTouchButton(BasicOneTouchButton.LEFT); button.setMinimumSize(new Dimension(ONE_TOUCH_SIZE, ONE_TOUCH_SIZE)); button.setRequestFocusEnabled(false); | protected JButton createLeftOneTouchButton() { int dir = SwingConstants.WEST; if (orientation == JSplitPane.VERTICAL_SPLIT) dir = SwingConstants.NORTH; JButton button = new BasicArrowButton(dir); button.setBorder(null); return button; } |
int dir = SwingConstants.EAST; if (orientation == JSplitPane.VERTICAL_SPLIT) dir = SwingConstants.SOUTH; JButton button = new BasicArrowButton(dir); button.setBorder(null); | JButton button = new BasicOneTouchButton(BasicOneTouchButton.RIGHT); button.setMinimumSize(new Dimension(ONE_TOUCH_SIZE, ONE_TOUCH_SIZE)); button.setRequestFocusEnabled(false); | protected JButton createRightOneTouchButton() { int dir = SwingConstants.EAST; if (orientation == JSplitPane.VERTICAL_SPLIT) dir = SwingConstants.SOUTH; JButton button = new BasicArrowButton(dir); button.setBorder(null); return button; } |
return getLayout().preferredLayoutSize(this); | Dimension d; if (orientation == JSplitPane.HORIZONTAL_SPLIT) d = new Dimension(getDividerSize(), 1); else d = new Dimension(1, getDividerSize()); return d; | public Dimension getPreferredSize() { return getLayout().preferredLayoutSize(this); } |
add(leftButton); add(rightButton); | if (rightButton != null) rightButton.addActionListener(new OneTouchAction()); | protected void oneTouchExpandableChanged() { if (splitPane.isOneTouchExpandable()) { leftButton = createLeftOneTouchButton(); rightButton = createRightOneTouchButton(); add(leftButton); add(rightButton); leftButton.addMouseListener(mouseHandler); rightButton.addMouseListener(mouseHandler); // Set it to 1. currentDividerLocation = 1; } else { if (leftButton != null && rightButton != null) { leftButton.removeMouseListener(mouseHandler); rightButton.removeMouseListener(mouseHandler); remove(leftButton); remove(rightButton); leftButton = null; rightButton = null; } } layout(); repaint(); } |
leftButton.addMouseListener(mouseHandler); rightButton.addMouseListener(mouseHandler); currentDividerLocation = 1; } else { | protected void oneTouchExpandableChanged() { if (splitPane.isOneTouchExpandable()) { leftButton = createLeftOneTouchButton(); rightButton = createRightOneTouchButton(); add(leftButton); add(rightButton); leftButton.addMouseListener(mouseHandler); rightButton.addMouseListener(mouseHandler); // Set it to 1. currentDividerLocation = 1; } else { if (leftButton != null && rightButton != null) { leftButton.removeMouseListener(mouseHandler); rightButton.removeMouseListener(mouseHandler); remove(leftButton); remove(rightButton); leftButton = null; rightButton = null; } } layout(); repaint(); } |
|
leftButton.removeMouseListener(mouseHandler); rightButton.removeMouseListener(mouseHandler); remove(leftButton); remove(rightButton); leftButton = null; rightButton = null; | add(leftButton); add(rightButton); | protected void oneTouchExpandableChanged() { if (splitPane.isOneTouchExpandable()) { leftButton = createLeftOneTouchButton(); rightButton = createRightOneTouchButton(); add(leftButton); add(rightButton); leftButton.addMouseListener(mouseHandler); rightButton.addMouseListener(mouseHandler); // Set it to 1. currentDividerLocation = 1; } else { if (leftButton != null && rightButton != null) { leftButton.removeMouseListener(mouseHandler); rightButton.removeMouseListener(mouseHandler); remove(leftButton); remove(rightButton); leftButton = null; rightButton = null; } } layout(); repaint(); } |
layout(); repaint(); | invalidate(); if (splitPane != null) splitPane.revalidate(); | protected void oneTouchExpandableChanged() { if (splitPane.isOneTouchExpandable()) { leftButton = createLeftOneTouchButton(); rightButton = createRightOneTouchButton(); add(leftButton); add(rightButton); leftButton.addMouseListener(mouseHandler); rightButton.addMouseListener(mouseHandler); // Set it to 1. currentDividerLocation = 1; } else { if (leftButton != null && rightButton != null) { leftButton.removeMouseListener(mouseHandler); rightButton.removeMouseListener(mouseHandler); remove(leftButton); remove(rightButton); leftButton = null; rightButton = null; } } layout(); repaint(); } |
if (splitPane.isOneTouchExpandable()) { ((BasicArrowButton) rightButton).paint(g); ((BasicArrowButton) leftButton).paint(g); } | public void paint(Graphics g) { Dimension dividerSize; super.paint(g); if (border != null) { dividerSize = getSize(); border.paintBorder(this, g, 0, 0, dividerSize.width, dividerSize.height); } if (splitPane.isOneTouchExpandable()) { ((BasicArrowButton) rightButton).paint(g); ((BasicArrowButton) leftButton).paint(g); } } |
|
if (splitPane.isOneTouchExpandable()) { layout(); repaint(); } | invalidate(); if (splitPane != null) splitPane.revalidate(); | public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JSplitPane.ONE_TOUCH_EXPANDABLE_PROPERTY)) oneTouchExpandableChanged(); else if (e.getPropertyName().equals(JSplitPane.ORIENTATION_PROPERTY)) { orientation = splitPane.getOrientation(); if (splitPane.isOneTouchExpandable()) { layout(); repaint(); } } else if (e.getPropertyName().equals(JSplitPane.DIVIDER_SIZE_PROPERTY)) dividerSize = splitPane.getDividerSize(); } |
if (splitPane.isOneTouchExpandable()) | public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) { /* Remove the connection to the existing JSplitPane. */ if (splitPane != null) { splitPane.removePropertyChangeListener(this); removeMouseListener(mouseHandler); removeMouseMotionListener(mouseHandler); splitPane = null; hiddenDivider = null; } /* Establish the connection to the new JSplitPane. */ splitPaneUI = newUI; if (splitPaneUI != null) splitPane = newUI.getSplitPane(); if (splitPane != null) { splitPane.addPropertyChangeListener(this); addMouseListener(mouseHandler); addMouseMotionListener(mouseHandler); hiddenDivider = splitPaneUI.getNonContinuousLayoutDivider(); orientation = splitPane.getOrientation(); oneTouchExpandableChanged(); } } |
|
protected Tag(String id) | public Tag() | protected Tag(String id) { name = id; flags = 0; } |
name = id; | name = null; | protected Tag(String id) { name = id; flags = 0; } |
panel.setLayout(null); | panel.setLayout(new FlowLayout(0, 0, 0)); | public void show() { // We insert a JPanel between the layered pane and the contents so we // can fiddle with the setLocation() method without disturbing a // JPopupMenu (which overrides setLocation in an unusual manner). if (panel == null) { panel = new JPanel(); panel.setLayout(null); } panel.add(contents); panel.setSize(contents.getSize()); Point layeredPaneLoc = layeredPane.getLocationOnScreen(); panel.setLocation(x - layeredPaneLoc.x, y - layeredPaneLoc.y); layeredPane.add(panel, JLayeredPane.POPUP_LAYER); } |
if (c == '\t' || c == '\n') | if (c == '\t') | public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); // The current x and y pixel coordinates. int pixelX = x; int pixelY = y - ascent; int pixelWidth = 0; int pos = s.offset; int len = 0; int end = s.offset + s.count; for (int offset = s.offset; offset < end; ++offset) { char c = buffer[offset]; if (c == '\t' || c == '\n') { if (len > 0) { g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0; } pos = offset+1; len = 0; } switch (c) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of ' '. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must jump to the next line. pixelY += metrics.getHeight(); pixelX = x; break; default: ++len; pixelWidth += metrics.charWidth(buffer[offset]); break; } } if (len > 0) g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); return pixelX + pixelWidth; } |
pixelX = (int) e.nextTabStop((float) pixelX, | pixelX = (int) e.nextTabStop(pixelX, | public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); // The current x and y pixel coordinates. int pixelX = x; int pixelY = y - ascent; int pixelWidth = 0; int pos = s.offset; int len = 0; int end = s.offset + s.count; for (int offset = s.offset; offset < end; ++offset) { char c = buffer[offset]; if (c == '\t' || c == '\n') { if (len > 0) { g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0; } pos = offset+1; len = 0; } switch (c) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of ' '. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must jump to the next line. pixelY += metrics.getHeight(); pixelX = x; break; default: ++len; pixelWidth += metrics.charWidth(buffer[offset]); break; } } if (len > 0) g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); return pixelX + pixelWidth; } |
break; case '\n': pixelY += metrics.getHeight(); pixelX = x; | public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); // The current x and y pixel coordinates. int pixelX = x; int pixelY = y - ascent; int pixelWidth = 0; int pos = s.offset; int len = 0; int end = s.offset + s.count; for (int offset = s.offset; offset < end; ++offset) { char c = buffer[offset]; if (c == '\t' || c == '\n') { if (len > 0) { g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0; } pos = offset+1; len = 0; } switch (c) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of ' '. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must jump to the next line. pixelY += metrics.getHeight(); pixelX = x; break; default: ++len; pixelWidth += metrics.charWidth(buffer[offset]); break; } } if (len > 0) g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); return pixelX + pixelWidth; } |
|
int preceding = breaker.preceding(mark + 1 - shift); | int preceding = breaker.preceding(mark + 1 + s.offset); | public static final int getBreakLocation(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset) { int mark = Utilities.getTabbedTextOffset(s, metrics, x0, x, e, startOffset, false); BreakIterator breaker = BreakIterator.getWordInstance(); breaker.setText(s); // If startOffset and s.offset differ then we need to use // that difference two convert the offset between the two metrics. int shift = startOffset - s.offset; // If mark is equal to the end of the string, just use that position. if (mark >= shift + s.count) return mark; // Try to find a word boundary previous to the mark at which we // can break the text. int preceding = breaker.preceding(mark + 1 - shift); if (preceding != 0) return preceding + shift; // If preceding is 0 we couldn't find a suitable word-boundary so // just break it on the character boundary return mark; } |
null) | new Position.Bias[1]) | static int getNextVisualPositionFrom(JTextComponent t, int offset, int direction) { NavigationFilter nf = t.getNavigationFilter(); try { return (nf != null) ? nf.getNextVisualPositionFrom(t, offset, Bias.Forward, direction, null) : t.getUI().getNextVisualPositionFrom(t, offset, Bias.Forward, direction, null); } catch (BadLocationException ble) { return offset; } } |
null); | new Position.Bias[1]); | static int getNextVisualPositionFrom(JTextComponent t, int offset, int direction) { NavigationFilter nf = t.getNavigationFilter(); try { return (nf != null) ? nf.getNextVisualPositionFrom(t, offset, Bias.Forward, direction, null) : t.getUI().getNextVisualPositionFrom(t, offset, Bias.Forward, direction, null); } catch (BadLocationException ble) { return offset; } } |
return pos + p0; | return pos; | public static final int getTabbedTextOffset(Segment s, FontMetrics fm, int x0, int x, TabExpander te, int p0, boolean round) { // At the end of the for loop, this holds the requested model location int pos; int currentX = x0; int width = 0; for (pos = 0; pos < s.count; pos++) { char nextChar = s.array[s.offset+pos]; if (nextChar == 0) break; if (nextChar != '\t') width = fm.charWidth(nextChar); else { if (te == null) width = fm.charWidth(' '); else width = ((int) te.nextTabStop(currentX, pos)) - currentX; } if (round) { if (currentX + (width>>1) > x) break; } else { if (currentX + width > x) break; } currentX += width; } return pos + p0; } |
pixelX = (int) e.nextTabStop((float) pixelX, | pixelX = (int) e.nextTabStop(pixelX, | public static final int getTabbedTextWidth(Segment s, FontMetrics metrics, int x, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The current x coordinate. int pixelX = x; // The current maximum width. int maxWidth = 0; for (int offset = s.offset; offset < (s.offset + s.count); ++offset) { switch (buffer[offset]) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of 'm'. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must 'draw' // the buffer and jump on the next line. pixelX += metrics.charWidth(buffer[offset]); maxWidth = Math.max(maxWidth, pixelX - x); pixelX = x; break; default: // Here we draw the char. pixelX += metrics.charWidth(buffer[offset]); break; } } // Take the last line into account. maxWidth = Math.max(maxWidth, pixelX - x); return maxWidth; } |
return Utilities.drawTabbedText(segment, x, y, g, this, 0); | return Utilities.drawTabbedText(segment, x, y, g, this, segment.offset); | protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException { g.setColor(unselectedColor); Segment segment = new Segment(); getDocument().getText(p0, p1 - p0, segment); return Utilities.drawTabbedText(segment, x, y, g, this, 0); } |
System.out.println(" we are adjusting "); | log.info(" we are adjusting "); | public void setBoundsForFrame(JComponent f, int x, int y, int w, int h) { System.out.println(" we are adjusting "); if (f instanceof MyInternalFrame == false) { super.setBoundsForFrame(f, x, y, w, h); // only deal w/internal frames } else { MyInternalFrame frame = (MyInternalFrame)f; // Figure out if we are being resized (otherwise it's just a move) boolean resizing = false; Object r = frame.getClientProperty(RESIZING); if (r != null && r instanceof Boolean) { resizing = ((Boolean)r).booleanValue(); } JDesktopPane desk = frame.getDesktopPane(); Dimension d = desk.getSize(); // Nothing all that fancy below, just figuring out how to adjust // to keep the frame on the desktop. if (x < 0) { // too far left? if (resizing) w += x; // don't get wider! x=0; // flush against the left side } else { if (x+w>d.width) { // too far right? if (resizing) w = d.width-x; // don't get wider! else x = d.width-w; // flush against the right side } } if (y < 0) { // too high? if (resizing) h += y; // don't get taller! y=0; // flush against the top } else { if (y+h > d.height) { // too low? if (resizing) h = d.height - y; // don't get taller! else y = d.height-h; // flush against the bottom } } // Set 'em the way we like 'em super.setBoundsForFrame(f, x, y, w, h);// ((MyInternalFrame)f).resizeMe(); } } |
e.printStackTrace(); | log.warn("In constructor: "+e); | public Gui5250MDIFrame(My5250 m) { super(m); enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } |
System.out.println("Can not set maximum " + pve.getMessage()); | log.warn("Can not set maximum " + pve.getMessage()); | public void addSessionView(String tabText,Session session) { MyInternalFrame frame = new MyInternalFrame(); frame.setVisible(true); desktop.add(frame); myFrameList.add(frame); selectedIndex = desktop.getComponentCount(); frame.setContentPane(session); try { frame.setSelected(true); } catch (java.beans.PropertyVetoException e) {} session.addSessionListener(this); session.addSessionJumpListener(this); try { frame.setMaximum(true); } catch (java.beans.PropertyVetoException pve) { System.out.println("Can not set maximum " + pve.getMessage()); } } |
log.debug(" current index " + x + " count " + frames.length + " has focus " + mif.isActive() + " title " + mif.getTitle() + " seq " + seq + " id " + mif.getInternalId()); | private MyInternalFrame getNextInternalFrame() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); if (miv == null) return null; int index = desktop.getIndexOf(miv); if (index == -1) return null; MyInternalFrame mix = (MyInternalFrame)frames[index]; int seq = mix.getInternalId(); index = 0; for (int x = 0; x < myFrameList.size(); x++) { MyInternalFrame mif = (MyInternalFrame)myFrameList.get(x);// System.out.println(" current index " + x + " count " + frames.length + " has focus " +// mif.isActive() + " title " + mif.getTitle() + " seq " + seq +// " id " + mif.getInternalId()); if (mix.equals(mif)) { index = x + 1; break; } } if (index > myFrameList.size() - 1) { index = 0; } return (MyInternalFrame)myFrameList.get(index); } |
|
System.out.println(e.getMessage()); | log.warn(e.getMessage()); | private void nextSession() { MyInternalFrame mif = getNextInternalFrame(); if (mif != null) { try { if (mif.isIcon()) { mif.setIcon(false); } mif.setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } }// System.out.println(" current index " + index + " count " + desktop.getComponentCount()); } |
System.out.println(changeEvent.getState() + " " + d); | log.info(changeEvent.getState() + " " + d); | public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getState() + " " + d); final int index = getIndexOfSession(ses);// System.out.println(" index of session " + index + " num frames " + desktop.getAllFrames().length); if (index == -1) return; Runnable tc = new Runnable () { public void run() { JInternalFrame[] frames = desktop.getAllFrames(); int id = ((MyInternalFrame)frames[index]).getInternalId(); frames[index].setTitle("#" + id + " " + d); } }; SwingUtilities.invokeLater(tc); } break; } } |
log.debug(" index of session " + index + " num frames " + desktop.getAllFrames().length); | public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getState() + " " + d); final int index = getIndexOfSession(ses);// System.out.println(" index of session " + index + " num frames " + desktop.getAllFrames().length); if (index == -1) return; Runnable tc = new Runnable () { public void run() { JInternalFrame[] frames = desktop.getAllFrames(); int id = ((MyInternalFrame)frames[index]).getInternalId(); frames[index].setTitle("#" + id + " " + d); } }; SwingUtilities.invokeLater(tc); } break; } } |
|
log.debug(" current index " + x + " count " + frames.length + " has focus " + mif.isActive() + " title " + mif.getTitle() + " seq " + seq + " id " + mif.getInternalId()); | private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); if (miv == null) return; int index = desktop.getIndexOf(miv); if (index == -1) return; MyInternalFrame mix = (MyInternalFrame)frames[index]; int seq = mix.getInternalId(); index = 0; for (int x = 0; x < myFrameList.size(); x++) { MyInternalFrame mif = (MyInternalFrame)myFrameList.get(x);// System.out.println(" current index " + x + " count " + frames.length + " has focus " +// mif.isActive() + " title " + mif.getTitle() + " seq " + seq +// " id " + mif.getInternalId()); if (mix.equals(mif)) { index = x - 1; break; } } if (index < 0) { index = myFrameList.size() - 1; } try { MyInternalFrame mif = (MyInternalFrame)myFrameList.get(index); if (mif.isIcon()) { mif.setIcon(false); } mif.setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); }// System.out.println(" current index " + index + " count " + desktop.getComponentCount()); } |
|
System.out.println(e.getMessage()); | log.warn(e.getMessage()); | private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); if (miv == null) return; int index = desktop.getIndexOf(miv); if (index == -1) return; MyInternalFrame mix = (MyInternalFrame)frames[index]; int seq = mix.getInternalId(); index = 0; for (int x = 0; x < myFrameList.size(); x++) { MyInternalFrame mif = (MyInternalFrame)myFrameList.get(x);// System.out.println(" current index " + x + " count " + frames.length + " has focus " +// mif.isActive() + " title " + mif.getTitle() + " seq " + seq +// " id " + mif.getInternalId()); if (mix.equals(mif)) { index = x - 1; break; } } if (index < 0) { index = myFrameList.size() - 1; } try { MyInternalFrame mif = (MyInternalFrame)myFrameList.get(index); if (mif.isIcon()) { mif.setIcon(false); } mif.setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); }// System.out.println(" current index " + index + " count " + desktop.getComponentCount()); } |
System.out.println("session found and closing down " + index); | log.info("session found and closing down " + index); | public void removeSessionView(Session targetSession) { int index = getIndexOfSession(targetSession); MyInternalFrame nextMIF = getNextInternalFrame(); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); MyInternalFrame mif = (MyInternalFrame)frames[index]; int count = getSessionViewCount();// System.out.println(" num of frames before removal " + myFrameList.size()); myFrameList.remove(mif);// System.out.println(" num of frames left " + myFrameList.size()); desktop.remove(index); if (nextMIF != null) { try { nextMIF.setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } this.repaint(); } |
log.debug(" num of frames before removal " + myFrameList.size()); | public void removeSessionView(Session targetSession) { int index = getIndexOfSession(targetSession); MyInternalFrame nextMIF = getNextInternalFrame(); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); MyInternalFrame mif = (MyInternalFrame)frames[index]; int count = getSessionViewCount();// System.out.println(" num of frames before removal " + myFrameList.size()); myFrameList.remove(mif);// System.out.println(" num of frames left " + myFrameList.size()); desktop.remove(index); if (nextMIF != null) { try { nextMIF.setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } this.repaint(); } |
|
log.debug(" num of frames left " + myFrameList.size()); | public void removeSessionView(Session targetSession) { int index = getIndexOfSession(targetSession); MyInternalFrame nextMIF = getNextInternalFrame(); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); MyInternalFrame mif = (MyInternalFrame)frames[index]; int count = getSessionViewCount();// System.out.println(" num of frames before removal " + myFrameList.size()); myFrameList.remove(mif);// System.out.println(" num of frames left " + myFrameList.size()); desktop.remove(index); if (nextMIF != null) { try { nextMIF.setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } this.repaint(); } |
|
System.out.println(e.getMessage()); | log.warn(e.getMessage()); | public void removeSessionView(Session targetSession) { int index = getIndexOfSession(targetSession); MyInternalFrame nextMIF = getNextInternalFrame(); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); MyInternalFrame mif = (MyInternalFrame)frames[index]; int count = getSessionViewCount();// System.out.println(" num of frames before removal " + myFrameList.size()); myFrameList.remove(mif);// System.out.println(" num of frames left " + myFrameList.size()); desktop.remove(index); if (nextMIF != null) { try { nextMIF.setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } this.repaint(); } |
threadIterator = threads.values().iterator(); index = 1; | reset(); | public DebugState process(KeyboardEvent event) { DebugState newState = this; switch (event.getKeyChar()) { case 'n': if (threadIterator.hasNext()) { final Thread t = (Thread) threadIterator.next(); newState = new ThreadState(this, t, index++); } break; case 'r': threadIterator = threads.values().iterator(); index = 1; break; default: return this; } event.consume(); return newState; } |
if (!initStageDone) super.addImpl(comp, constraints, index); | if (isRootPaneCheckingEnabled()) getContentPane().add(comp, constraints, index); | protected void addImpl(Component comp, Object constraints, int index) { // If we're adding in the initialization stage use super.add. // Otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not add directly to JDialog." + " Use getContentPane().add instead."); getContentPane().add(comp, constraints, index); } } |
{ if (isRootPaneCheckingEnabled()) throw new Error("Do not add directly to JDialog." + " Use getContentPane().add instead."); getContentPane().add(comp, constraints, index); } | super.addImpl(comp, constraints, index); | protected void addImpl(Component comp, Object constraints, int index) { // If we're adding in the initialization stage use super.add. // Otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not add directly to JDialog." + " Use getContentPane().add instead."); getContentPane().add(comp, constraints, index); } } |
initStageDone = true; | setRootPaneCheckingEnabled(true); | protected void dialogInit() { // FIXME: Do a check on GraphicsEnvironment.isHeadless() setLocale(JComponent.getDefaultLocale()); getRootPane(); // Will do set/create. invalidate(); // Now that initStageDone is true, adds and layouts apply to contentPane, // not top-level. initStageDone = true; } |
if (initStageDone) { | public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set top-level layout. Use" + " getConentPane().setLayout instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); } |
|
throw new Error("Cannot set top-level layout. Use" + " getConentPane().setLayout instead."); | public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set top-level layout. Use" + " getConentPane().setLayout instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); } |
|
} | public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set top-level layout. Use" + " getConentPane().setLayout instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); } |
|
Dimension prefSize = getPreferredSize(); prefSize.width = Math.max(prefSize.width, minimumSize.width); prefSize.height = Math.max(prefSize.height, minimumSize.height); setPreferredSize(prefSize); Dimension maxSize = getMaximumSize(); maxSize.width = Math.max(maxSize.width, minimumSize.width); maxSize.height = Math.max(maxSize.height, minimumSize.height); setMaximumSize(maxSize); | public void setMinimumSize(Dimension min) { Dimension oldMinimumSize = minimumSize; minimumSize = min; firePropertyChange("minimumSize", oldMinimumSize, minimumSize); revalidate(); repaint(); } |
|
kbArea = new Rectangle2D.Float(); | public GuiGraphicBuffer () { tArea = new Rectangle2D.Float(); cArea = new Rectangle2D.Float(); aArea = new Rectangle2D.Float(); sArea = new Rectangle2D.Float(); pArea = new Rectangle2D.Float(); mArea = new Rectangle2D.Float(); iArea = new Rectangle2D.Float(); } |
|
if (gg2d == null) { return; } | public synchronized void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x,y); // tell waiting threads to wake up lock.notify(); } } |
|
kbArea.setRect((float)(sArea.getX()+ sArea.getWidth()) + (20 * fmWidth), fmHeight * (numRows + 1), fmWidth + fmWidth, fmHeight); | public Graphics2D drawOIA (int fmWidth, int fmHeight, int numRows, int numCols, Font font, Color colorBg, Color colorBlue ) { Graphics2D g2d; // get ourselves a global pointer to the graphics g2d = (Graphics2D)bi.getGraphics(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED); g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED); g2d.setFont(font); g2d.setColor(colorBg); g2d.fillRect(0,0,bi.getWidth(null),bi.getHeight(null)); tArea.setRect(0,0,bi.getWidth(null),(fmHeight * (numRows))); cArea.setRect(0,fmHeight * (numRows + 1),bi.getWidth(null),fmHeight * (numRows + 1)); aArea.setRect(0,0,bi.getWidth(null),bi.getHeight(null)); sArea.setRect(fmWidth * 9,fmHeight * (numRows + 1),fmWidth * 20,fmHeight); pArea.setRect(bi.getWidth(null) - fmWidth * 6,fmHeight * (numRows + 1),fmWidth * 6,fmHeight); mArea.setRect((float)(sArea.getX()+ sArea.getWidth()) + fmWidth + fmWidth, fmHeight * (numRows + 1), fmWidth + fmWidth, fmHeight);// cArea = new Rectangle2D.Float(0,fmHeight * (numRows + 1),bi.getWidth(null),fmHeight * (numRows + 1));// aArea = new Rectangle2D.Float(0,0,bi.getWidth(null),bi.getHeight(null));// sArea = new Rectangle2D.Float(fmWidth * 9,fmHeight * (numRows + 1),fmWidth * 20,fmHeight);// pArea = new Rectangle2D.Float(bi.getWidth(null) - fmWidth * 6,fmHeight * (numRows + 1),fmWidth * 6,fmHeight);// mArea = new Rectangle2D.Float((float)(sArea.getX()+ sArea.getWidth()) + fmWidth + fmWidth,// fmHeight * (numRows + 1),// fmWidth + fmWidth,// fmHeight); separatorLine.setLine(0, (fmHeight * (numRows + 1)) - (fmHeight / 2), bi.getWidth(null), (fmHeight * (numRows + 1)) - (fmHeight / 2)); g2d.setColor(colorBlue); g2d.draw(separatorLine); return g2d; } |
|
bad.minor = Minor.Any; | public static TaggedComponent[] extract(Any any) { try { return ((MultipleComponentProfileHolder) any.extract_Streamable()).value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("MultipleComponentProfile expected"); bad.initCause(cex); throw bad; } } |
|
orb.setPort(PORT); orb.init(args, null); | Functional_ORB.setPort(Functional_ORB.DEFAULT_INITIAL_PORT); | public static void main(String[] args) { int port = PORT; String iorf = null; try { // Create and initialize the ORB final Functional_ORB orb = new Functional_ORB(); orb.setPort(PORT); orb.init(args, null); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); orb.connect(namer, getDefaultKey()); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args [ i ].endsWith("ORBInitialPort")) port = Integer.parseInt(args [ i + 1 ]); if (args [ i ].equals("-ior")) iorf = args [ i + 1 ]; } orb.setPort(port); // Storing the IOR reference. String ior = orb.object_to_string(namer); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath, transient naming service. " + "Copyright (C) 2005 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior ); new Thread() { public void run() { // wait for invocations from clients orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } } |
sb = new StringBuffer(); | public KeyStrokenizer() { setKeyStrokes(null); } |
|
String ks = keyStrokes.substring(index); keyStrokes.setLength(0); return ks; | return keyStrokes.substring(index); | public String getUnprocessedKeyStroked() { if(index >= length)// if (keyStrokes.length() == 0) return null; else {// return keyStrokes.toString(); String ks = keyStrokes.substring(index); keyStrokes.setLength(0); return ks; } } |
"at position " + index); | "at position " + index + " len " + length ); | public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; } |
" mnemonic key was not not complete ending not found :2 " + | " mnemonic key was incomplete ending not found :2 " + | public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; } |
" mnemonic key was not not complete ending not found :3 " + | " mnemonic key was incomplete ending not found :3 " + | public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; } |
} c = keyStrokes.charAt(index); if(c == ']') { | public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; } |
|
System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); | c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was incomplete beginning not found :4 " + "at position " + index); } | public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; } |
keyStrokes.delete(start,index); index = 0; length = keyStrokes.length(); | public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; } |
|
keyStrokes.append(strokes); | keyStrokes.setLength(0); | public void setKeyStrokes (String strokes) { if (strokes != null) {// keyStrokes.setLength(0); keyStrokes.append(strokes);// System.out.println("set "+ keyStrokes);// index = 0; length = keyStrokes.length(); } else { keyStrokes = new StringBuffer(); sb = new StringBuffer(); index = 0; length = 0; } } |
length = keyStrokes.length(); | length = strokes.length(); | public void setKeyStrokes (String strokes) { if (strokes != null) {// keyStrokes.setLength(0); keyStrokes.append(strokes);// System.out.println("set "+ keyStrokes);// index = 0; length = keyStrokes.length(); } else { keyStrokes = new StringBuffer(); sb = new StringBuffer(); index = 0; length = 0; } } |
sb = new StringBuffer(); index = 0; | public void setKeyStrokes (String strokes) { if (strokes != null) {// keyStrokes.setLength(0); keyStrokes.append(strokes);// System.out.println("set "+ keyStrokes);// index = 0; length = keyStrokes.length(); } else { keyStrokes = new StringBuffer(); sb = new StringBuffer(); index = 0; length = 0; } } |
|
keyStrokes.append(strokes); index = 0; | public void setKeyStrokes (String strokes) { if (strokes != null) {// keyStrokes.setLength(0); keyStrokes.append(strokes);// System.out.println("set "+ keyStrokes);// index = 0; length = keyStrokes.length(); } else { keyStrokes = new StringBuffer(); sb = new StringBuffer(); index = 0; length = 0; } } |
|
synchronized (lock) { | public synchronized void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) { System.out.println(" we got a null graphic object "); return; } //synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x,y); // tell waiting threads to wake up //lock.notifyAll(); //} } |
|
lock.notifyAll(); } | public synchronized void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) { System.out.println(" we got a null graphic object "); return; } //synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x,y); // tell waiting threads to wake up //lock.notifyAll(); //} } |
|
if (isJavaMIMEType(name)) { return name.substring(GNU_JAVA_MIME_PREFIX.length()); } else | public static String decodeJavaMIMEType (String name) { return null; } |
|
if (df != null) { return encodeJavaMIMEType(df.getMimeType()); } else | public static String encodeDataFlavor (DataFlavor df) { return null; } |
|
if (mime != null) return GNU_JAVA_MIME_PREFIX + mime; else | public static String encodeJavaMIMEType (String mime) { return null; } |
|
return false; | return (name != null && name.startsWith(GNU_JAVA_MIME_PREFIX)); | public static boolean isJavaMIMEType (String name) { return false; } |
vt.isOnSignoffScreen(); | private void closeSession() { vt.isOnSignoffScreen(); Object[] message = new Object[1]; message[0] = LangTool.getString("cs.message"); String[] options = {LangTool.getString("cs.optThis"), LangTool.getString("cs.optAll"), LangTool.getString("cs.optCancel")}; int result = JOptionPane.showOptionDialog( this.getParent(), // the parent that the dialog blocks message, // the dialog message array LangTool.getString("cs.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); if (result == 0) { closeMe(); } if (result == 1) { me.closingDown((Session)this); } } |
|
closeMe(); | if (!isOnSignoffScreen()) { if (confirmClose()) { closeMe(); } } else { closeMe(); } | private void closeSession() { vt.isOnSignoffScreen(); Object[] message = new Object[1]; message[0] = LangTool.getString("cs.message"); String[] options = {LangTool.getString("cs.optThis"), LangTool.getString("cs.optAll"), LangTool.getString("cs.optCancel")}; int result = JOptionPane.showOptionDialog( this.getParent(), // the parent that the dialog blocks message, // the dialog message array LangTool.getString("cs.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); if (result == 0) { closeMe(); } if (result == 1) { me.closingDown((Session)this); } } |
Vector listeners = sesConfig.getSessionConfigListeners(); Enumeration e = listeners.elements(); while (e.hasMoreElements()) { sa.addPropertyChangeListener((Session)e.nextElement()); } | private void doAttributes() { Frame parent = null; // if me is null then we must be called from an applet so we create // a new frame object. if (me == null) parent = new JFrame(); else parent = (Frame)me.getParentView((Session)this); SessionAttributes sa = new SessionAttributes(parent,sesConfig); Vector listeners = sesConfig.getSessionConfigListeners(); Enumeration e = listeners.elements(); while (e.hasMoreElements()) { sa.addPropertyChangeListener((Session)e.nextElement()); } sa.showIt(); listeners = sesConfig.getSessionConfigListeners(); e = listeners.elements(); while (e.hasMoreElements()) { sa.removePropertyChangeListener((Session)e.nextElement()); } getFocusForMe(); sa = null; } |
|
listeners = sesConfig.getSessionConfigListeners(); e = listeners.elements(); while (e.hasMoreElements()) { sa.removePropertyChangeListener((Session)e.nextElement()); } | private void doAttributes() { Frame parent = null; // if me is null then we must be called from an applet so we create // a new frame object. if (me == null) parent = new JFrame(); else parent = (Frame)me.getParentView((Session)this); SessionAttributes sa = new SessionAttributes(parent,sesConfig); Vector listeners = sesConfig.getSessionConfigListeners(); Enumeration e = listeners.elements(); while (e.hasMoreElements()) { sa.addPropertyChangeListener((Session)e.nextElement()); } sa.showIt(); listeners = sesConfig.getSessionConfigListeners(); e = listeners.elements(); while (e.hasMoreElements()) { sa.removePropertyChangeListener((Session)e.nextElement()); } getFocusForMe(); sa = null; } |
|
if (keyMap.isKeyStrokeDefined(MNEMONIC_JUMP_PREV + ".alt2")) { ks = keyMap.getKeyStroke(MNEMONIC_JUMP_PREV + ".alt2"); getInputMap().put(ks,MNEMONIC_JUMP_PREV); getActionMap().put(MNEMONIC_JUMP_PREV,prevSession ); } | private void initKeyBindings() { KeyStroke ks; Action newSession = new AbstractAction(MNEMONIC_OPEN_NEW) { public void actionPerformed(ActionEvent e) { me.startNewSession(); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_OPEN_NEW)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_N,KeyEvent.ALT_MASK); } else { ks = keyMap.getKeyStroke(MNEMONIC_OPEN_NEW); } getInputMap().put(ks,MNEMONIC_OPEN_NEW); getActionMap().put(MNEMONIC_OPEN_NEW,newSession ); Action chgSession = new AbstractAction(MNEMONIC_TOGGLE_CONNECTION) { public void actionPerformed(ActionEvent e) { changeConnection(); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_TOGGLE_CONNECTION)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_X,KeyEvent.ALT_MASK); } else { ks = keyMap.getKeyStroke(MNEMONIC_TOGGLE_CONNECTION); } getInputMap().put(ks,MNEMONIC_TOGGLE_CONNECTION); getActionMap().put(MNEMONIC_TOGGLE_CONNECTION,chgSession ); Action nxtSession = new AbstractAction(MNEMONIC_JUMP_NEXT) { public void actionPerformed(ActionEvent e) { nextSession(); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_JUMP_NEXT)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP,KeyEvent.ALT_MASK); } else { ks = keyMap.getKeyStroke(MNEMONIC_JUMP_NEXT); } getInputMap().put(ks,MNEMONIC_JUMP_NEXT); getActionMap().put(MNEMONIC_JUMP_NEXT,nxtSession ); Action prevSession = new AbstractAction(MNEMONIC_JUMP_PREV) { public void actionPerformed(ActionEvent e) { prevSession(); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_JUMP_PREV)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN,KeyEvent.ALT_MASK); } else { ks = keyMap.getKeyStroke(MNEMONIC_JUMP_PREV); } getInputMap().put(ks,MNEMONIC_JUMP_PREV); getActionMap().put(MNEMONIC_JUMP_PREV,prevSession ); Action hotSpots = new AbstractAction(MNEMONIC_HOTSPOTS) { public void actionPerformed(ActionEvent e) { screen.toggleHotSpots(); System.out.println(MNEMONIC_HOTSPOTS); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_HOTSPOTS)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_S,KeyEvent.ALT_MASK); } else { ks = keyMap.getKeyStroke(MNEMONIC_HOTSPOTS); } getInputMap().put(ks,MNEMONIC_HOTSPOTS); getActionMap().put(MNEMONIC_HOTSPOTS,hotSpots ); Action gui = new AbstractAction(MNEMONIC_GUI) { public void actionPerformed(ActionEvent e) { screen.toggleGUIInterface(); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_GUI)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_G,KeyEvent.ALT_MASK); } else { ks = keyMap.getKeyStroke(MNEMONIC_GUI); } getInputMap().put(ks,MNEMONIC_GUI); getActionMap().put(MNEMONIC_GUI,gui ); Action msg = new AbstractAction(MNEMONIC_DISP_MESSAGES) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_DISP_MESSAGES)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_M,KeyEvent.ALT_MASK); } else { ks = keyMap.getKeyStroke(MNEMONIC_DISP_MESSAGES); } getInputMap().put(ks,MNEMONIC_DISP_MESSAGES); getActionMap().put(MNEMONIC_DISP_MESSAGES,msg ); Action attr = new AbstractAction(MNEMONIC_DISP_ATTRIBUTES) { public void actionPerformed(ActionEvent e) { doAttributes(); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_DISP_ATTRIBUTES)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_D,KeyEvent.ALT_MASK); } else { ks = keyMap.getKeyStroke(MNEMONIC_DISP_ATTRIBUTES); } getInputMap().put(ks,MNEMONIC_DISP_ATTRIBUTES); getActionMap().put(MNEMONIC_DISP_ATTRIBUTES,attr ); Action print = new AbstractAction(MNEMONIC_PRINT_SCREEN) { public void actionPerformed(ActionEvent e) { printMe(); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_PRINT_SCREEN)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_P,KeyEvent.ALT_MASK); } else { ks = keyMap.getKeyStroke(MNEMONIC_PRINT_SCREEN); } getInputMap().put(ks,MNEMONIC_PRINT_SCREEN); getActionMap().put(MNEMONIC_PRINT_SCREEN,print ); Action cursor = new AbstractAction(MNEMONIC_CURSOR) { public void actionPerformed(ActionEvent e) { screen.crossHair(); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_CURSOR)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_L,KeyEvent.ALT_MASK,false); } else { ks = keyMap.getKeyStroke(MNEMONIC_CURSOR); } getInputMap().put(ks,MNEMONIC_CURSOR); getActionMap().put(MNEMONIC_CURSOR,cursor ); Action debug = new AbstractAction(MNEMONIC_DEBUG) { public void actionPerformed(ActionEvent e) { vt.toggleDebug(); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_DEBUG)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_O,KeyEvent.ALT_MASK); } else { ks = keyMap.getKeyStroke(MNEMONIC_DEBUG); } getInputMap().put(ks,MNEMONIC_DEBUG); getActionMap().put(MNEMONIC_DEBUG,debug ); Action close = new AbstractAction(MNEMONIC_CLOSE) { public void actionPerformed(ActionEvent e) { closeSession(); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_CLOSE)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_Q,KeyEvent.ALT_MASK); } else { ks = keyMap.getKeyStroke(MNEMONIC_CLOSE); } getInputMap().put(ks,MNEMONIC_CLOSE); getActionMap().put(MNEMONIC_CLOSE,close ); Action transfer = new AbstractAction(MNEMONIC_FILE_TRANSFER) { public void actionPerformed(ActionEvent e) { doMeTransfer(); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_FILE_TRANSFER)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_T,KeyEvent.ALT_MASK); } else { ks = keyMap.getKeyStroke(MNEMONIC_FILE_TRANSFER); } getInputMap().put(ks,MNEMONIC_FILE_TRANSFER); getActionMap().put(MNEMONIC_FILE_TRANSFER,transfer ); Action e_mail = new AbstractAction(MNEMONIC_E_MAIL) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_E_MAIL)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_E,KeyEvent.ALT_MASK); } else { ks = keyMap.getKeyStroke(MNEMONIC_E_MAIL); } getInputMap().put(ks,MNEMONIC_E_MAIL); getActionMap().put(MNEMONIC_E_MAIL,e_mail ); Action runScript = new AbstractAction(MNEMONIC_RUN_SCRIPT) { public void actionPerformed(ActionEvent e) { runScript(); } }; if (!keyMap.isKeyStrokeDefined(MNEMONIC_RUN_SCRIPT)) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_R,KeyEvent.ALT_MASK); } else { ks = keyMap.getKeyStroke(MNEMONIC_RUN_SCRIPT); } getInputMap().put(ks,MNEMONIC_RUN_SCRIPT); getActionMap().put(MNEMONIC_RUN_SCRIPT,runScript ); Action spclDump = new AbstractAction("special dump") { public void actionPerformed(ActionEvent e) { dumpStuff(new Throwable()); } };// if (!keyMap.isKeyStrokeDefined("special dump")) { ks = KeyStroke.getKeyStroke(KeyEvent.VK_O,KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK);// }// else {// ks = keyMap.getKeyStroke(MNEMONIC_RUN_SCRIPT);// } getInputMap().put(ks,"special dump"); getActionMap().put("special dump",spclDump );//// Action ohshit = new AbstractAction() {// public void actionPerformed(ActionEvent e) {// System.out.println(e.getActionCommand());// }// };// // HashMap hm = keyMap.getKeyMap();// //// // Collection v = hm.values();// // Set o = hm.keySet();// // Iterator k = o.iterator();// // Iterator i = v.iterator();// //// // while (k.hasNext()) {// // KeyStroker ksr = (KeyStroker)k.next();// // String keyVal = (String)i.next();// // Action ohshit = new AbstractAction(keyVal) {// // public void actionPerformed(ActionEvent e) {// // System.out.println("action command :" + e);// // }// // };// // int mask = 0;// // if (ksr.isAltDown())// // mask |= KeyEvent.ALT_MASK;// // if (ksr.isControlDown())// // mask |= KeyEvent.CTRL_MASK;// // if (ksr.isShiftDown())// // mask |= KeyEvent.SHIFT_MASK;// // if (ksr.isAltGrDown())// // mask |= KeyEvent.META_MASK;// //// // ohshit.putValue(Action.NAME, keyVal);// //// // ks = KeyStroke.getKeyStroke(ksr.getKeyCode(),mask);// //// // System.out.println(keyVal + " " + ks);// // getInputMap().put(ks,keyVal);// // getActionMap().put(keyVal,new MyAction(keyVal) );// //// // // if (keyVal.equals(which)) {// // // mappedKeys.remove(ks);// // // mappedKeys.put(new KeyStroker(ke.getKeyCode(),// // // ke.isShiftDown(),// // // ke.isControlDown(),// // // ke.isAltDown(),// // // isAltGr),keyVal);// // // return;// // // }// // } } |
|
public void onConfigChanged(SessionConfigEvent changeEvent) { | public void onConfigChanged(SessionConfigEvent pce) { | public void onConfigChanged(SessionConfigEvent changeEvent) { } |
String pn = pce.getPropertyName(); if (pn.equals("keypad")) { if (((String)pce.getNewValue()).equals("Yes")) { keyPad.setVisible(true); } else { keyPad.setVisible(false); } this.validate(); } if (pn.equals("doubleClick")) { if (((String)pce.getNewValue()).equals("Yes")) { doubleClick = true; } else { doubleClick = false; } } screen.propertyChange(pce); resizeMe(); repaint(); | public void onConfigChanged(SessionConfigEvent changeEvent) { } |
|
array[0] = 1 / 3 + (blue - red) / delta; | array[0] = 1f / 3 + (blue - red) / delta; | public static float[] RGBtoHSB(int red, int green, int blue, float array[]) { if (array == null) array = new float[3]; // Calculate brightness. int min; int max; if (red < green) { min = red; max = green; } else { min = green; max = red; } if (blue > max) max = blue; else if (blue < min) min = blue; array[2] = max / 255f; // Calculate saturation. if (max == 0) array[1] = 0; else array[1] = (max - min) / max; // Calculate hue. if (array[1] == 0) array[0] = 0; else { float delta = (max - min) * 6; if (red == max) array[0] = (green - blue) / delta; else if (green == max) array[0] = 1 / 3 + (blue - red) / delta; else array[0] = 2 / 3 + (red - green) / delta; if (array[0] < 0) array[0]++; } return array; } |
array[0] = 2 / 3 + (red - green) / delta; | array[0] = 2f / 3 + (red - green) / delta; | public static float[] RGBtoHSB(int red, int green, int blue, float array[]) { if (array == null) array = new float[3]; // Calculate brightness. int min; int max; if (red < green) { min = red; max = green; } else { min = green; max = red; } if (blue > max) max = blue; else if (blue < min) min = blue; array[2] = max / 255f; // Calculate saturation. if (max == 0) array[1] = 0; else array[1] = (max - min) / max; // Calculate hue. if (array[1] == 0) array[0] = 0; else { float delta = (max - min) * 6; if (red == max) array[0] = (green - blue) / delta; else if (green == max) array[0] = 1 / 3 + (blue - red) / delta; else array[0] = 2 / 3 + (red - green) / delta; if (array[0] < 0) array[0]++; } return array; } |
frame.doDefaultCloseAction(); | public void closeFrame(JInternalFrame frame) { Container c = frame.getParent(); frame.doDefaultCloseAction(); if (c != null) { if (frame.isIcon()) c.remove(frame.getDesktopIcon()); else c.remove(frame); c.repaint(); } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.