rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
setCursorOn();
public void sendKeys(String text) {// if (text == null) {// return;// } if (isStatusErrorCode() && !resetRequired) { resetError(); if (!cursorActive) setCursorOn(); } if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]"...
if (!keysBuffered)
public void setCursorOn() { updateCursorLoc = true;// System.out.println("cursor on"); updateCursorLoc(); }
int editorWidth = comboBox.getBounds().width - arrowButtonWidth - 2;
int arrowSize = comboBox.getHeight(); int editorWidth = comboBox.getBounds().width - arrowSize;
public void layoutContainer(Container parent) { // Position editor component to the left of arrow button if combo box is // editable int editorWidth = comboBox.getBounds().width - arrowButtonWidth - 2; if (comboBox.isEditable()) editor.setBounds(borderInsets.left, borderInsets.top, editorWid...
editor.setBounds(borderInsets.left, borderInsets.top, editorWidth, comboBox.getBounds().height - borderInsets.left - borderInsets.top); arrowButton.setBounds(editorWidth, 2, arrowButtonWidth, comboBox.getBounds().height - 4);
editor.setBounds(0, 0, editorWidth, comboBox.getBounds().height); arrowButton.setBounds(editorWidth, 0, arrowSize, arrowSize);
public void layoutContainer(Container parent) { // Position editor component to the left of arrow button if combo box is // editable int editorWidth = comboBox.getBounds().width - arrowButtonWidth - 2; if (comboBox.isEditable()) editor.setBounds(borderInsets.left, borderInsets.top, editorWid...
Dimension d = new Dimension(0, 0); if (largestItemSize == null) largestItemSize = getLargestItemSize(); d.width += largestItemSize.getWidth(); d.height += largestItemSize.getHeight(); d.width += arrowButtonWidth; d.width += borderInsets.left + borderInsets.right; d.height += borderInsets.left + borderInsets.righ...
return getPreferredSize((JComponent) parent);
public Dimension preferredLayoutSize(Container parent) { Dimension d = new Dimension(0, 0); if (largestItemSize == null) largestItemSize = getLargestItemSize(); // add size for the area that will display selected item d.width += largestItemSize.getWidth(); d.height += largestItemSize.get...
int start = e.getIndex0(); int end = e.getIndex1();
public void intervalAdded(ListDataEvent e) { // must determine if the size of the combo box should change int start = e.getIndex0(); int end = e.getIndex1(); ComboBoxModel model = comboBox.getModel(); ListCellRenderer renderer = comboBox.getRenderer(); if (largestItemSize == null) l...
if (largestItemSize == null) largestItemSize = new Dimension(0, 0);
if (displaySize == null) displaySize = getDisplaySize(); if (displaySize.width < getDefaultSize().width) displaySize.width = getDefaultSize().width; if (displaySize.height < getDefaultSize().height) displaySize.height = getDefaultSize().height;
public void intervalAdded(ListDataEvent e) { // must determine if the size of the combo box should change int start = e.getIndex0(); int end = e.getIndex1(); ComboBoxModel model = comboBox.getModel(); ListCellRenderer renderer = comboBox.getRenderer(); if (largestItemSize == null) l...
for (int i = start; i < end; i++) { Object item = model.getElementAt(i); Component comp = renderer.getListCellRendererComponent(new JList(), item, -1, false, false); if (comp.getPreferredSize().getWidth() > largestItemSize.getWidth()) largestItemSize = comp.getPreferredSize(); }
comboBox.repaint();
public void intervalAdded(ListDataEvent e) { // must determine if the size of the combo box should change int start = e.getIndex0(); int end = e.getIndex1(); ComboBoxModel model = comboBox.getModel(); ListCellRenderer renderer = comboBox.getRenderer(); if (largestItemSize == null) l...
largestItemSize = getLargestItemSize();
displaySize = getDisplaySize();
public void intervalRemoved(ListDataEvent e) { // recalculate display size of the JComboBox. largestItemSize = getLargestItemSize(); comboBox.repaint(); }
{ if (e.getSource() instanceof JComboBox) { arrowButton.getModel().setPressed(true); arrowButton.getModel().setArmed(true); } comboBox.repaint(); if (e.getSource() instanceof BasicArrowButton) toggleOpenClose(); }
toggleOpenClose();
public void mousePressed(MouseEvent e) { if (comboBox.isEnabled()) { if (e.getSource() instanceof JComboBox) { arrowButton.getModel().setPressed(true); arrowButton.getModel().setArmed(true); } comboBox.repaint(); if (e.getSource() instanceof BasicArrowButton) toggleOpenC...
else if (e.getPropertyName().equals("font")) { Font font = (Font) e.getNewValue(); editor.setFont(font); listBox.setFont(font); arrowButton.setFont(font); comboBox.revalidate(); comboBox.repaint(); }
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("enabled")) { arrowButton.setEnabled(comboBox.isEnabled()); if (comboBox.isEditable()) comboBox.getEditor().getEditorComponent().setEnabled(comboBox .isE...
arrowButton.addMouseListener(mouseListener);
arrowButton.setEnabled(comboBox.isEnabled()); arrowButton.setFont(comboBox.getFont()); arrowButton.setMargin(new Insets(0, 0, 0, 0));
public void configureArrowButton() { arrowButton.addMouseListener(mouseListener); }
editor.setFont(comboBox.getFont()); comboBox.getEditor().setItem(comboBox.getSelectedItem());
protected void configureEditor() { // FIXME: Need to implement. Set font and add listeners. }
return new Dimension(6, 17);
return new Dimension(100, 5);
protected Dimension getDefaultSize() { return new Dimension(6, 17); }
return null;
return MAXIMUM_SIZE;
public Dimension getMaximumSize(JComponent c) { return null; }
return null;
Dimension d = getDisplaySize(); Dimension arrowDim = arrowButton.getPreferredSize(); Dimension result = new Dimension(d.width + arrowDim.width, Math.max(d.height, arrowDim.height)); return result;
public Dimension getMinimumSize(JComponent c) { return null; }
return null;
return getMinimumSize(c);
public Dimension getPreferredSize(JComponent c) { // return null to indicate that combo box's layout will determin its // preferred size return null; }
configureArrowButton();
protected void installComponents() { // create and install arrow button arrowButton = createArrowButton(); comboBox.add(arrowButton); // Set list that will be used by BasicComboBoxRender // in order to determine the right colors when rendering listBox = new JList(); Color background = arrowButt...
Color background = arrowButton.getBackground(); listBox.setBackground(background); listBox.setSelectionBackground(background.darker()); Color foreground = arrowButton.getForeground(); listBox.setForeground(foreground); listBox.setSelectionForeground(foreground);
protected void installComponents() { // create and install arrow button arrowButton = createArrowButton(); comboBox.add(arrowButton); // Set list that will be used by BasicComboBoxRender // in order to determine the right colors when rendering listBox = new JList(); Color background = arrowButt...
comboBox.setBackground(defaults.getColor("ComboBox.background")); comboBox.setFont(defaults.getFont("ComboBox.font")); comboBox.setForeground(defaults.getColor("ComboBox.foreground"));
if (comboBox.getFont() instanceof UIResource) comboBox.setFont(defaults.getFont("ComboBox.font")); if (comboBox.getForeground() instanceof UIResource) comboBox.setForeground(defaults.getColor("ComboBox.foreground"));
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); comboBox.setBackground(defaults.getColor("ComboBox.background")); comboBox.setFont(defaults.getFont("ComboBox.font")); comboBox.setForeground(defaults.getColor("ComboBox.foreground")); // Set default color tha...
shadow = defaults.getColor("Button.shadow"); darkShadow = defaults.getColor("Button.darkShadow"); lightHighlight = defaults.getColor("Button.light"); highlight = defaults.getColor("Button.highlight");
if (comboBox.getBackground() instanceof UIResource) comboBox.setBackground(defaults.getColor("ComboBox.background")); shadow = defaults.getColor("ComboBox.buttonShadow"); darkShadow = defaults.getColor("ComboBox.buttonDarkShadow"); highlight = defaults.getColor("ComboBox.buttonHighlight");
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); comboBox.setBackground(defaults.getColor("ComboBox.background")); comboBox.setFont(defaults.getFont("ComboBox.font")); comboBox.setForeground(defaults.getColor("ComboBox.foreground")); // Set default color tha...
comboBox.addMouseListener(mouseListener);
arrowButton.addMouseListener(mouseListener);
protected void installListeners() { // install combo box's listeners propertyChangeListener = createPropertyChangeListener(); comboBox.addPropertyChangeListener(propertyChangeListener); focusListener = createFocusListener(); comboBox.addFocusListener(focusListener); itemListener = createItemListene...
configureArrowButton();
protected void installListeners() { // install combo box's listeners propertyChangeListener = createPropertyChangeListener(); comboBox.addPropertyChangeListener(propertyChangeListener); focusListener = createFocusListener(); comboBox.addFocusListener(focusListener); itemListener = createItemListene...
if (comboBox.isEditable())
if (!comboBox.isEditable())
public boolean isFocusTraversable(JComboBox c) { if (comboBox.isEditable()) return true; return false; }
if (c instanceof JComboBox) { JComboBox cb = (JComboBox) c; paintBorder(g, comboBox.getBounds(), hasFocus); Rectangle rect = rectangleForCurrentValue(); paintCurrentValueBackground(g, rect, hasFocus); paintCurrentValue(g, rect, hasFocus); }
Rectangle rect = rectangleForCurrentValue(); paintCurrentValueBackground(g, rect, hasFocus); paintCurrentValue(g, rect, hasFocus);
public void paint(Graphics g, JComponent c) { if (c instanceof JComboBox) { JComboBox cb = (JComboBox) c; paintBorder(g, comboBox.getBounds(), hasFocus); Rectangle rect = rectangleForCurrentValue(); paintCurrentValueBackground(g, rect, hasFocus); paintCurrentValue(g, rect, hasFocus); } }
Component comp = comboBox.getRenderer() .getListCellRendererComponent(listBox, (currentValue != null ? currentValue : ""), -1, isPressed, hasFocus); if (! comboBox.isEnabled()) comp.setEnabled(false); g.translate(borderInsets.left, borderInsets.top); comp.setBounds(0, 0, bounds.width, bounds.height); comp.paint(g); g....
Component comp = comboBox.getRenderer().getListCellRendererComponent( listBox, (currentValue != null ? currentValue : ""), -1, isPressed, hasFocus); if (! comboBox.isEnabled()) { comp.setBackground(UIManager.getLookAndFeelDefaults().getColor( "ComboBox.disabledBackground")); comp.setForeground(UIManager.getLookAndFeelD...
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) { if (! comboBox.isEditable()) { Object currentValue = comboBox.getSelectedItem(); boolean isPressed = arrowButton.getModel().isPressed(); /* Gets the component to be drawn for the current value. * If there is currently no selecte...
Rectangle cbBounds = comboBox.getBounds(); Rectangle rectForCurrentValue = new Rectangle(cbBounds.x + borderInsets.left, cbBounds.y + borderInsets.top, cbBounds.width - arrowButtonWidth - borderInsets.left - borderInsets.right, cbBounds.height - borderInsets.top - borderInsets.bottom);
Rectangle cbBounds = SwingUtilities.getLocalBounds(comboBox); Rectangle abBounds = arrowButton.getBounds(); Rectangle rectForCurrentValue = new Rectangle(cbBounds.x, cbBounds.y, cbBounds.width - abBounds.width, cbBounds.height);
protected Rectangle rectangleForCurrentValue() { Rectangle cbBounds = comboBox.getBounds(); // Subtract width or the arrow button and border insets Rectangle rectForCurrentValue = new Rectangle(cbBounds.x + borderInsets.left, ...
arrowButton.removeMouseListener(mouseListener);
public void unconfigureArrowButton() { arrowButton.removeMouseListener(mouseListener); }
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
if (comboBox.getFont() instanceof UIResource) comboBox.setFont(null);
protected void uninstallDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); comboBox.setBackground(null); comboBox.setFont(null); comboBox.setForeground(null); shadow = null; darkShadow = null; lightHighlight = null; highlight = null; }
comboBox.setBackground(null); comboBox.setFont(null); comboBox.setForeground(null);
if (comboBox.getForeground() instanceof UIResource) comboBox.setForeground(null); if (comboBox.getBackground() instanceof UIResource) comboBox.setBackground(null);
protected void uninstallDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); comboBox.setBackground(null); comboBox.setFont(null); comboBox.setForeground(null); shadow = null; darkShadow = null; lightHighlight = null; highlight = null; }
lightHighlight = null;
protected void uninstallDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); comboBox.setBackground(null); comboBox.setFont(null); comboBox.setForeground(null); shadow = null; darkShadow = null; lightHighlight = null; highlight = null; }
comboBox.removeMouseListener(mouseListener);
arrowButton.removeMouseListener(mouseListener);
protected void uninstallListeners() { comboBox.removePropertyChangeListener(propertyChangeListener); propertyChangeListener = null; comboBox.removeFocusListener(focusListener); focusListener = null; comboBox.removeItemListener(itemListener); itemListener = null; comboBox.removeKeyListener(keyLis...
unconfigureArrowButton();
protected void uninstallListeners() { comboBox.removePropertyChangeListener(propertyChangeListener); propertyChangeListener = null; comboBox.removeFocusListener(focusListener); focusListener = null; comboBox.removeItemListener(itemListener); itemListener = null; comboBox.removeKeyListener(keyLis...
InputMap im = new InputMap ();
InputMapUIResource im = new InputMapUIResource ();
public Object createValue(UIDefaults table) { InputMap im = new InputMap (); for (int i = 0; 2*i+1 < bind.length; ++i) { im.put (KeyStroke.getKeyStroke ((String) bind[2*i]), bind[2*i+1]); } return im; }
im.put (KeyStroke.getKeyStroke ((String) bind[2*i]),
Object curr = bind[2*i]; if (curr instanceof KeyStroke) im.put((KeyStroke) curr, bind[2*i+1]); else im.put(KeyStroke.getKeyStroke((String) curr),
public Object createValue(UIDefaults table) { InputMap im = new InputMap (); for (int i = 0; 2*i+1 < bind.length; ++i) { im.put (KeyStroke.getKeyStroke ((String) bind[2*i]), bind[2*i+1]); } return im; }
super();
public FocusManager() { // TODO }
return null;
KeyboardFocusManager fm = KeyboardFocusManager.getCurrentKeyboardFocusManager(); if (fm instanceof FocusManager) return (FocusManager) fm; else { System.err.println("The Swing FocusManager API has been obsoleted by"); System.err.println("the new KeyboardFocusManager system."); System.err.println("You should either not ...
public static FocusManager getCurrentManager() { return null; // TODO }
KeyboardFocusManager.setCurrentKeyboardFocusManager(manager);
public static void setCurrentManager(FocusManager manager) { // TODO }
setFocusable(false);
public BasicArrowButton(int direction) { super(); setDirection(direction); }
return MAXIMUM_SIZE;
return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
public Dimension getMaximumSize() { return MAXIMUM_SIZE; }
return MINIMUM_SIZE;
return new Dimension(5, 5);
public Dimension getMinimumSize() { return MINIMUM_SIZE; }
return PREFERRED_SIZE;
return new Dimension(16, 16);
public Dimension getPreferredSize() { return PREFERRED_SIZE; }
Rectangle bounds = getBounds(); int size = bounds.height / 4; int x = bounds.x + (bounds.width - size) / 2; int y = (bounds.height - size) / 4;
int height = getHeight(); int size = height / 4; int x = (getWidth() - size) / 2; int y = (height - size) / 2;
public void paint(Graphics g) { super.paint(g); Rectangle bounds = getBounds(); int size = bounds.height / 4; int x = bounds.x + (bounds.width - size) / 2; int y = (bounds.height - size) / 4; ButtonModel m = getModel(); if (m.isArmed()) { x++; y++; } paintTriangle(g, x...
synchronized(obj.openGroupNodeHash) {
synchronized(this.openGroupNodeHash) {
private String dealWithClosingGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(obj.openGroupNodeHash) { Iterator iter = obj.openGroupNodeHash.iterator(); /...
Iterator iter = obj.openGroupNodeHash.iterator();
Iterator iter = this.openGroupNodeHash.iterator();
private String dealWithClosingGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(obj.openGroupNodeHash) { Iterator iter = obj.openGroupNodeHash.iterator(); /...
obj.openGroupNodeHash.remove(openGroup);
this.openGroupNodeHash.remove(openGroup);
private String dealWithClosingGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(obj.openGroupNodeHash) { Iterator iter = obj.openGroupNodeHash.iterator(); /...
synchronized(obj.openGroupNodeHash) {
synchronized(this.openGroupNodeHash) {
private String dealWithOpeningGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(obj.openGroupNodeHash) { Iterator iter = obj.groupMemberHash.iterator(); // ...
if(!obj.openGroupNodeHash.contains(memberGroup)) {
if(!this.openGroupNodeHash.contains(memberGroup)) {
private String dealWithOpeningGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(obj.openGroupNodeHash) { Iterator iter = obj.groupMemberHash.iterator(); // ...
indent.concat(sPrettyXDFOutputIndentation); memberGroup.toXDFOutputStream(outputstream, indent); obj.openGroupNodeHash.add(memberGroup);
newIndent.append(sPrettyXDFOutputIndentation); memberGroup.toXDFOutputStream(outputstream, new Hashtable(), newIndent.toString(), true, null, null); this.openGroupNodeHash.add(memberGroup);
private String dealWithOpeningGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(obj.openGroupNodeHash) { Iterator iter = obj.groupMemberHash.iterator(); // ...
return indent;
return newIndent.toString();
private String dealWithOpeningGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(obj.openGroupNodeHash) { Iterator iter = obj.groupMemberHash.iterator(); // ...
{ writeOut(outputstream,"<" + sXDFRootNodeName); } else { writeOut(outputstream,"<" + nodeNameString); }
nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString);
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString,...
if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName == null){ writeOut(outputstream, "></" + nodeNameString + ">"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; }
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString,...
if ((sPrettyXDFOutput) && (pcdata == null) && (childObjs.size() !=0)) writeOut(outputstream, Constants.NEW_LINE);
if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE);
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString,...
dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent);
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString,...
if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ;
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString,...
writeOut(outputstream, "</"+nodeNameString + ">");
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString,...
return ;
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString,...
if (sPrettyXDFOutput) writeOut(outputstream, indent); if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else {
indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode)
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString,...
}
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString,...
writeOut(outputstream, ">");
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString,...
String t = new Date(e.getWhen()).toString();
public void actionPerformed(ActionEvent e) { String t = new Date(e.getWhen()).toString(); Session ses; for (int x = 0; x < sessions.size(); x++) { try { ses = (Session)sessions.get(x); if (ses.isConnected() && ses.isSendKeepAlive()) { ses.getVT().sendHeartBe...
if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalScrollBarUI instance; if (o == null) { instance = new MetalScrollBarUI(); instances.put(component, instance); } else instance = (MetalScrollBarUI) o; return instance;
return new MetalScrollBarUI();
public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalScrollBarUI instance; if (o == null) { instance = new MetalScrollBarUI(); instances.put(component, instance); } else instance ...
g.setColor(thumbDarkShadowColor); g.drawRect(thumbBounds.x, thumbBounds.y, thumbBounds.width - 1, thumbBounds.height - 1);
int hAdj = 1; int wAdj = 1; if (scrollbar.getOrientation() == HORIZONTAL) hAdj++; else wAdj++; g.setColor(new Color(102, 102, 153)); g.drawRect(thumbBounds.x, thumbBounds.y, thumbBounds.width - wAdj, thumbBounds.height - hAdj);
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) { // first we fill the background g.setColor(thumbColor); g.fillRect(thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height); // draw the outer dark line g.setColor(thumbDarkShadowColor); g.drawRec...
thumbHighlightColor, thumbDarkShadowColor);
thumbHighlightColor, new Color(102, 102, 153));
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) { // first we fill the background g.setColor(thumbColor); g.fillRect(thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height); // draw the outer dark line g.setColor(thumbDarkShadowColor); g.drawRec...
return ftpFile.getTimestamp().getTimeInMillis();
return ftpFile.lastModified().getTime();
public long getLastModified() throws IOException { //return ftpFile.lastModified().getTime(); return ftpFile.getTimestamp().getTimeInMillis(); }
return ftpFile.isDirectory();
return ftpFile.isDir();
public boolean isDirectory() { return ftpFile.isDirectory(); }
return !ftpFile.isFile();
return !ftpFile.isDir() && !ftpFile.isLink();
public boolean isFile() { return !ftpFile.isFile(); }
styleTable.put(DEFAULT_STYLE, defaultStyle);
public StyleContext() { listenerList = new EventListenerList(); styleTable = new Hashtable(); }
(sb.charAt(len) <= ' ' || sb.charAt(len) >= '\uff20' )) {
(sb.charAt(len) < ' ' || sb.charAt(len) >= '\uff20' )) {
protected void readFormatTable(ByteArrayOutputStream baosp,int readType, CodePage codePage) { ScreenField sf; boolean isSigned = false; char c; if (masterMDT) { StringBuffer sb = new StringBuffer(); for (int x = 0; x < sizeFields; x++) { ...
if (sf.isSignedNumeric() && sb.charAt(sb.length() - 1) == '-') {
if (sf.isSignedNumeric() && sb.length() > 0 && sb.charAt(sb.length() - 1) == '-') {
protected void readFormatTable(ByteArrayOutputStream baosp,int readType, CodePage codePage) { ScreenField sf; boolean isSigned = false; char c; if (masterMDT) { StringBuffer sb = new StringBuffer(); for (int x = 0; x < sizeFields; x++) { ...
jarClassPaths = userDir + File.separator + "jython.jar";
jarClassPaths = "." + File.pathSeparator + "jython.jar" + File.pathSeparator + "jt400.jar" + File.pathSeparator + "itext.jar"; if (sessions.contains("scriptClassPath")) { jarClassPaths += File.pathSeparator + sessions.getProperty("scriptClassPath"); }
private void initJarPaths() { String userDir = System.getProperty("user.dir"); if (new File(userDir + File.separator + "jython.jar").exists()) { jarClassPaths = userDir + File.separator + "jython.jar"; } if (jarClassPaths != null) System.setProperty("python.path",jarClassPaths); ...
Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionAr...
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap de...
}
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap de...
char c = event.getActionCommand().charAt(0); if (Character.isISOControl(c)) return; JTextComponent t = getTextComponent(event); if (t != null && t.isEnabled() && t.isEditable()) t.replaceSelection(event.getActionCommand());
JTextComponent target = getTextComponent(event); if ((target != null) && (event != null)) { if ((target.isEditable()) && (target.isEnabled())) { String content = event.getActionCommand(); int mod = event.getModifiers(); if ((content != null) && (content.length() > 0) && (mod & ActionEvent.ALT_MASK) == 0 && (mod & Actio...
public void actionPerformed(ActionEvent event) { // first we filter the following events: // - control characters // - key events with the ALT modifier (FIXME: filter that too!) char c = event.getActionCommand().charAt(0); if (Character.isISOControl(c)) return; ...
screen.pasteMe(false);
screen.sendKeys(MNEMONIC_PASTE);
private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()) - (screen.getCols()-1); if (!rubberband.isAreaSelected() && s...
screen.copyMe();
screen.sendKeys(MNEMONIC_COPY);
private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()) - (screen.getCols()-1); if (!rubberband.isAreaSelected() && s...
screen.pasteMe(false);
screen.sendKeys(MNEMONIC_PASTE);
public void actionPerformed(ActionEvent e) { screen.pasteMe(false); getFocusForMe(); }
screen.copyMe();
screen.sendKeys(MNEMONIC_COPY);
public void actionPerformed(ActionEvent e) { screen.copyMe(); getFocusForMe(); }
stopMacro = false;
stopMacro = !macroRunning;
public void setMacroRunning(boolean mr) { macroRunning = mr; if (macroRunning) screen.setSRIndicatorOn(); else screen.setSRIndicatorOff(); stopMacro = false; }
setMacroRunning(true); macroRunning = false;
setMacroRunning(false);
public void setStopMacroRequested () { setMacroRunning(true); macroRunning = false; }
System.out.println(srcFile + " not found !");
log.warn(srcFile + " not found !");
private void copyConfigs(String sesFile) { /** Copy the config-files to the user's home-dir */ String srcFile = System.getProperty("user.dir") + File.separator + sesFile; String dest = System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator + sesFile; File rmvFil...
System.out.println("Global io-error !");
log.warn("Global io-error !");
private void copyConfigs(String sesFile) { /** Copy the config-files to the user's home-dir */ String srcFile = System.getProperty("user.dir") + File.separator + sesFile; String dest = System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator + sesFile; File rmvFil...
System.out.println(" Information Message: "
log.info(" Information Message: "
private void loadSettings() { FileInputStream in = null; FileInputStream again = null; settings = new Properties(); // here we will check for a system property is provided first. if (System.getProperties().containsKey("emulator.settingsDirectory")) { settings.setProperty("emul...
System.out.println("IO Exception accessing File "
log.warn("IO Exception accessing File "
private void loadSettings() { FileInputStream in = null; FileInputStream again = null; settings = new Properties(); // here we will check for a system property is provided first. if (System.getProperties().containsKey("emulator.settingsDirectory")) { settings.setProperty("emul...
System.out.println("Security Exception for file "
log.warn("Security Exception for file "
private void loadSettings() { FileInputStream in = null; FileInputStream again = null; settings = new Properties(); // here we will check for a system property is provided first. if (System.getProperties().containsKey("emulator.settingsDirectory")) { settings.setProperty("emul...
out.write(buf.length + 1);
writeLength(out, buf.length + 1);
private static int writeBitString(OutputStream out, BitString bs) throws IOException { byte[] buf = bs.getShiftedByteArray(); out.write(buf.length + 1); out.write(bs.getIgnoredBits()); out.write(buf); return buf.length; }
return buf.length;
return buf.length + 1;
private static int writeBitString(OutputStream out, BitString bs) throws IOException { byte[] buf = bs.getShiftedByteArray(); out.write(buf.length + 1); out.write(bs.getIgnoredBits()); out.write(buf); return buf.length; }
if (nextFreePtr == null) {
if (nextFreePtr.EQ(Address.zero())) {
protected Object alloc(VmClassType<?> vmClass, int alignedSize) { if (nextFreePtr == null) { /* This heap is full */ return null; } final Offset tibOffset = this.tibOffset; final Word headerSize = Word.fromIntZeroExtend(this.headerSize); final Offset flagsOffset = this.flagsOffset...
Address objectPtr = null;
Address objectPtr = Address.zero();
protected Object alloc(VmClassType<?> vmClass, int alignedSize) { if (nextFreePtr == null) { /* This heap is full */ return null; } final Offset tibOffset = this.tibOffset; final Word headerSize = Word.fromIntZeroExtend(this.headerSize); final Offset flagsOffset = this.flagsOffset...
nextFreePtr = null;
nextFreePtr = Address.zero();
protected Object alloc(VmClassType<?> vmClass, int alignedSize) { if (nextFreePtr == null) { /* This heap is full */ return null; } final Offset tibOffset = this.tibOffset; final Word headerSize = Word.fromIntZeroExtend(this.headerSize); final Offset flagsOffset = this.flagsOffset...
Address firstFreePtr = null;
Address firstFreePtr = Address.zero();
protected final void defragment() throws UninterruptiblePragma { final Word size = Word.fromIntZeroExtend(getSize()); final Word headerSize = Word.fromIntZeroExtend(this.headerSize); Word offset = headerSize; final Offset sizeOffset = this.sizeOffset; final Offset tibOffset = this...
try {
public static void main(String[] args) { try { String s = null; s.length(); System.out.println("No throw of NPE: NOK!"); } catch (NullPointerException ex) { System.out.println("catch of NPE: OK! (" + ex + ")"); } }
} catch (NullPointerException ex) { System.out.println("catch of NPE: OK! (" + ex + ")"); }
public static void main(String[] args) { try { String s = null; s.length(); System.out.println("No throw of NPE: NOK!"); } catch (NullPointerException ex) { System.out.println("catch of NPE: OK! (" + ex + ")"); } }
return encoded.array();
byte[] ret = encoded.array(); if (ret.length > len) { byte[] ret2 = new byte[len]; System.arraycopy(ret, 0, ret2, 0, len); ret = ret2; } return ret;
final byte[] encodeText(String text) throws IOException { encoder.reset(); if (!encoder.canEncode(text)) { // Check each character StringBuffer buf = new StringBuffer(); int len = text.length(); for (int i = 0; i < len; i++) { char c = text.charAt(i); ...
int len = encoded.limit() - encoded.position();
final byte[] encodeText(String text) throws IOException { encoder.reset(); if (!encoder.canEncode(text)) { // Check each character StringBuffer buf = new StringBuffer(); int len = text.length(); for (int i = 0; i < len; i++) { char c = text.charAt(i); ...
return ftpFile.getSize();
return ftpFile.size();
public long getLength() { return ftpFile.getSize(); }
fileSystem.cwd(parent.path()); InputStream in = fileSystem.retrieveFileStream(getName()); int i = in.available(); data = new byte[i]; in.read(data);
fileSystem.chdir(parent.path()); data = fileSystem.get(getName());
public synchronized void read(long fileOffset, ByteBuffer dest) throws IOException { try { if(data == null){ synchronized(fileSystem) { fileSystem.cwd(parent.path()); //data = fileSystem.get(getName()); InputStream in = fileSy...
private Object get(int index) { Object result = cp[ index]; return result;
private final Object get(int index) { return cp[ index];
private Object get(int index) { Object result = cp[ index]; /* * if (result == null) { System.err.println("Warning: cp[" + index + "] * (tag " + tags[index] + ") returns null"); */ return result; }
public int indexOf(Object object) {
public final int indexOf(Object object) {
public int indexOf(Object object) { for (int i = 0; i < used; i++) { final Object o = cp[ i]; if ((o != null) && (o.equals(object))) { return i; } } return -1; }
if (blink.isSelected()) { changes.firePropertyChange(this,"cursorBlink", getStringProperty("cursorBlink"), "Yes"); setProperty("cursorBlink","Yes"); } else { changes.firePropertyChange(this,"cursorBlink", getStringProperty("cursorBlink"), "No"); setProperty("cursorBlink","No"); }
public void applyAttributes() { if (cFull.isSelected()) { changes.firePropertyChange(this,"cursorSize", getStringProperty("cursorSize"), "Full"); setProperty("cursorSize","Full"); } if (cHalf.isSelected()) { changes.fireProper...