rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
} | public void endDraggingFrame(JComponent component) { if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE) { setBoundsForFrame((JInternalFrame) component, dragCache.x, dragCache.y, dragCache.width, dragCache.height); pane = null; dragCache = null; } component.repaint(); } |
|
} | public void endDraggingFrame(JComponent component) { if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE) { setBoundsForFrame((JInternalFrame) component, dragCache.x, dragCache.y, dragCache.width, dragCache.height); pane = null; dragCache = null; } component.repaint(); } |
|
} | public void endResizingFrame(JComponent component) { if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE) { setBoundsForFrame((JInternalFrame) component, dragCache.x, dragCache.y, dragCache.width, dragCache.height); pane = null; dragCache = null; } component.repaint(); } |
|
} | public void endResizingFrame(JComponent component) { if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE) { setBoundsForFrame((JInternalFrame) component, dragCache.x, dragCache.y, dragCache.width, dragCache.height); pane = null; dragCache = null; } component.repaint(); } |
|
component.revalidate(); if (component.getParent() != null) component.getParent().repaint(); else component.repaint(); | public void setBoundsForFrame(JComponent component, int newX, int newY, int newWidth, int newHeight) { component.setBounds(newX, newY, newWidth, newHeight); component.revalidate(); // If not null, I'd rather repaint the parent if (component.getParent() != null) component.getParent().repaint(); else component.repaint(); } |
|
throw new BAD_OPERATION("Binding expected"); | BAD_OPERATION bad = new BAD_OPERATION("Binding expected"); bad.minor = Minor.Any; bad.initCause(ex); throw bad; | public static Binding extract(Any a) { try { return ((BindingHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION("Binding expected"); } } |
screen52.homePos = hPos; | screen52.setPendingInsert(true,screen52.getRow(pos), screen52.getCol(pos)); | public final void restoreScreen() throws IOException { int which = 0; try {// System.out.println("Restore "); bk.getNextByte(); bk.getNextByte(); int rows = bk.getNextByte() & 0xff; int cols = bk.getNextByte() & 0xff; int pos = bk.getNextByte() << 8 & 0xff00; pos |= bk.getNextByte() & 0xff; int hPos = bk.getNextByte() << 8 & 0xff00; hPos |= bk.getNextByte() & 0xff; if (rows != screen52.getRows()) screen52.setRowsCols(rows,cols); screen52.clearAll(); // initialize what we currenty have int b = 32; int la = 32; int len = rows * cols; for (int y = 0;y < len; y++) { b = bk.getNextByte(); if (isAttribute(b)) { screen52.screen[y].setCharAndAttr( screen52.screen[y].getChar(), b, true); la = b; } else { screen52.screen[y].setCharAndAttr( getASCIIChar(b), la, false); } } int numFields = bk.getNextByte() << 8 & 0xff00; numFields |= bk.getNextByte() & 0xff;// System.out.println("number of fields " + numFields); if (numFields > 0) { int x = 0; int attr = 0; int fPos = 0; int fLen = 0; int ffw1 = 0; int ffw2 = 0; int fcw1 = 0; int fcw2 = 0; boolean mdt = false; ScreenField sf = null; while (x < numFields) { attr = bk.getNextByte(); fPos = bk.getNextByte() << 8 & 0xff00; fPos |= bk.getNextByte() & 0xff; if (bk.getNextByte() == 1) mdt = true; else mdt = false; fLen = bk.getNextByte() << 8 & 0xff00; fLen |= bk.getNextByte() & 0xff; ffw1 = bk.getNextByte(); ffw2 = bk.getNextByte(); fcw1 = bk.getNextByte(); fcw2 = bk.getNextByte(); sf = screen52.getScreenFields().setField(attr, screen52.getRow(fPos), screen52.getCol(fPos), fLen, ffw1, ffw2, fcw1, fcw2); if (mdt) sf.setMDT();// System.out.println("/nRestored ");// System.out.println(sf.toString());// x++; } } screen52.restoreScreen(); // display the screen screen52.homePos = hPos; screen52.goto_XY(pos); screen52.isInField(); if (screen52.isUsingGuiInterface()) screen52.drawFields(); } catch (Exception e) { System.out.println("error restoring screen " + which + " with " + e.getMessage()); } } |
Component[] children = AWTUtilities.getVisibleChildren(parent); | List children = AWTUtilities.getVisibleChildren(parent); | void layoutAlgorithm(Container parent, Direction layoutDir, Direction crossDir) { if (parent != container) throw new AWTError("invalid parent"); Dimension parentSize = parent.getSize(); Insets insets = parent.getInsets(); Dimension innerSize = new Dimension(parentSize.width - insets.left - insets.right, parentSize.height - insets.bottom - insets.top); // Set all components to their preferredSizes and sum up the allocated // space. Create SizeReqs for each component and store them in // sizeReqs. Find the maximum size in the crossing direction. Component[] children = AWTUtilities.getVisibleChildren(parent); Vector sizeReqs = new Vector(); int allocated = 0; for (int i = 0; i < children.length; i++) { Component c = children[i]; SizeReq sizeReq = new SizeReq(c, layoutDir); int preferred = layoutDir.size(c.getPreferredSize()); sizeReq.size = preferred; allocated += preferred; sizeReqs.add(sizeReq); } // Distribute remaining space (may be positive or negative) over components int remainder = layoutDir.size(innerSize) - allocated; distributeSpace(sizeReqs, remainder, layoutDir); // Resize and relocate components. If the component can be sized to // take the full space in the crossing direction, then do so, otherwise // align according to its alingnmentX or alignmentY property. int loc = 0; int offset1 = layoutDir.lower(insets); int offset2 = crossDir.lower(insets); for (Iterator i = sizeReqs.iterator(); i.hasNext();) { SizeReq sizeReq = (SizeReq) i.next(); Component c = sizeReq.comp; int availCrossSize = crossDir.size(innerSize); int maxCross = crossDir.size(c.getMaximumSize()); int crossSize = Math.min(availCrossSize, maxCross); int crossRemainder = availCrossSize - crossSize; int crossLoc = (int) (crossDir.alignment(c) * crossRemainder); layoutDir.setSize(c, sizeReq.size, crossSize); layoutDir.setLocation(c, offset1 + loc, offset2 + crossLoc); loc += sizeReq.size; } } |
for (int i = 0; i < children.length; i++) | for (Iterator i = children.iterator(); i.hasNext();) | void layoutAlgorithm(Container parent, Direction layoutDir, Direction crossDir) { if (parent != container) throw new AWTError("invalid parent"); Dimension parentSize = parent.getSize(); Insets insets = parent.getInsets(); Dimension innerSize = new Dimension(parentSize.width - insets.left - insets.right, parentSize.height - insets.bottom - insets.top); // Set all components to their preferredSizes and sum up the allocated // space. Create SizeReqs for each component and store them in // sizeReqs. Find the maximum size in the crossing direction. Component[] children = AWTUtilities.getVisibleChildren(parent); Vector sizeReqs = new Vector(); int allocated = 0; for (int i = 0; i < children.length; i++) { Component c = children[i]; SizeReq sizeReq = new SizeReq(c, layoutDir); int preferred = layoutDir.size(c.getPreferredSize()); sizeReq.size = preferred; allocated += preferred; sizeReqs.add(sizeReq); } // Distribute remaining space (may be positive or negative) over components int remainder = layoutDir.size(innerSize) - allocated; distributeSpace(sizeReqs, remainder, layoutDir); // Resize and relocate components. If the component can be sized to // take the full space in the crossing direction, then do so, otherwise // align according to its alingnmentX or alignmentY property. int loc = 0; int offset1 = layoutDir.lower(insets); int offset2 = crossDir.lower(insets); for (Iterator i = sizeReqs.iterator(); i.hasNext();) { SizeReq sizeReq = (SizeReq) i.next(); Component c = sizeReq.comp; int availCrossSize = crossDir.size(innerSize); int maxCross = crossDir.size(c.getMaximumSize()); int crossSize = Math.min(availCrossSize, maxCross); int crossRemainder = availCrossSize - crossSize; int crossLoc = (int) (crossDir.alignment(c) * crossRemainder); layoutDir.setSize(c, sizeReq.size, crossSize); layoutDir.setLocation(c, offset1 + loc, offset2 + crossLoc); loc += sizeReq.size; } } |
Component c = children[i]; | Component c = (Component) i.next(); | void layoutAlgorithm(Container parent, Direction layoutDir, Direction crossDir) { if (parent != container) throw new AWTError("invalid parent"); Dimension parentSize = parent.getSize(); Insets insets = parent.getInsets(); Dimension innerSize = new Dimension(parentSize.width - insets.left - insets.right, parentSize.height - insets.bottom - insets.top); // Set all components to their preferredSizes and sum up the allocated // space. Create SizeReqs for each component and store them in // sizeReqs. Find the maximum size in the crossing direction. Component[] children = AWTUtilities.getVisibleChildren(parent); Vector sizeReqs = new Vector(); int allocated = 0; for (int i = 0; i < children.length; i++) { Component c = children[i]; SizeReq sizeReq = new SizeReq(c, layoutDir); int preferred = layoutDir.size(c.getPreferredSize()); sizeReq.size = preferred; allocated += preferred; sizeReqs.add(sizeReq); } // Distribute remaining space (may be positive or negative) over components int remainder = layoutDir.size(innerSize) - allocated; distributeSpace(sizeReqs, remainder, layoutDir); // Resize and relocate components. If the component can be sized to // take the full space in the crossing direction, then do so, otherwise // align according to its alingnmentX or alignmentY property. int loc = 0; int offset1 = layoutDir.lower(insets); int offset2 = crossDir.lower(insets); for (Iterator i = sizeReqs.iterator(); i.hasNext();) { SizeReq sizeReq = (SizeReq) i.next(); Component c = sizeReq.comp; int availCrossSize = crossDir.size(innerSize); int maxCross = crossDir.size(c.getMaximumSize()); int crossSize = Math.min(availCrossSize, maxCross); int crossRemainder = availCrossSize - crossSize; int crossLoc = (int) (crossDir.alignment(c) * crossRemainder); layoutDir.setSize(c, sizeReq.size, crossSize); layoutDir.setLocation(c, offset1 + loc, offset2 + crossLoc); loc += sizeReq.size; } } |
Component[] children = AWTUtilities.getVisibleChildren(parent); | List children = AWTUtilities.getVisibleChildren(parent); | public Dimension maximumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.top + insets.bottom; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); x += sz.width; // Check for overflow. if (x < 0) x = Integer.MAX_VALUE; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); y += sz.height; // Check for overflow if (y < 0) y = Integer.MAX_VALUE; x = Math.max(x, sz.width); } } return new Dimension(x, y); } |
for (int index = 0; index < children.length; index++) | for (Iterator i = children.iterator(); i.hasNext();) | public Dimension maximumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.top + insets.bottom; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); x += sz.width; // Check for overflow. if (x < 0) x = Integer.MAX_VALUE; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); y += sz.height; // Check for overflow if (y < 0) y = Integer.MAX_VALUE; x = Math.max(x, sz.width); } } return new Dimension(x, y); } |
Component comp = children[index]; | Component comp = (Component) i.next(); | public Dimension maximumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.top + insets.bottom; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); x += sz.width; // Check for overflow. if (x < 0) x = Integer.MAX_VALUE; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); y += sz.height; // Check for overflow if (y < 0) y = Integer.MAX_VALUE; x = Math.max(x, sz.width); } } return new Dimension(x, y); } |
Component[] children = AWTUtilities.getVisibleChildren(parent); | List children = AWTUtilities.getVisibleChildren(parent); | public Dimension minimumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.bottom + insets.top; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); x += sz.width; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); y += sz.height; x = Math.max(x, sz.width); } } return new Dimension(x, y); } |
for (int index = 0; index < children.length; index++) | for (Iterator i = children.iterator(); i.hasNext();) | public Dimension minimumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.bottom + insets.top; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); x += sz.width; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); y += sz.height; x = Math.max(x, sz.width); } } return new Dimension(x, y); } |
Component comp = children[index]; | Component comp = (Component) i.next(); | public Dimension minimumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.bottom + insets.top; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); x += sz.width; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); y += sz.height; x = Math.max(x, sz.width); } } return new Dimension(x, y); } |
Component[] children = AWTUtilities.getVisibleChildren(parent); | List children = AWTUtilities.getVisibleChildren(parent); | public Dimension preferredLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = 0; int y = 0; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { x = insets.left + insets.right; // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); x += sz.width; y = Math.max(y, sz.height); } y += insets.bottom + insets.top; } else { y = insets.top + insets.bottom; // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); y += sz.height; x = Math.max(x, sz.width); } x += insets.left + insets.right; } return new Dimension(x, y); } |
for (int index = 0; index < children.length; index++) | for (Iterator i = children.iterator(); i.hasNext();) | public Dimension preferredLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = 0; int y = 0; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { x = insets.left + insets.right; // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); x += sz.width; y = Math.max(y, sz.height); } y += insets.bottom + insets.top; } else { y = insets.top + insets.bottom; // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); y += sz.height; x = Math.max(x, sz.width); } x += insets.left + insets.right; } return new Dimension(x, y); } |
Component comp = children[index]; | Component comp = (Component) i.next(); | public Dimension preferredLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = 0; int y = 0; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { x = insets.left + insets.right; // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); x += sz.width; y = Math.max(y, sz.height); } y += insets.bottom + insets.top; } else { y = insets.top + insets.bottom; // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); y += sz.height; x = Math.max(x, sz.width); } x += insets.left + insets.right; } return new Dimension(x, y); } |
if (CurrentArray.getDataCube().getHref() != null) DATABLOCK.append(getHrefData(CurrentArray.getDataCube().getHref())); | public Object action (SaxDocumentHandler handler, AttributeList attrs) { // we only need to do these things for the first time we enter // a data node if (DataNodeLevel == 0) { // update the array dataCube with passed attributes CurrentArray.getDataCube().setXMLAttributes(attrs); // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } // reset to start of which dataformat type we currently are reading CurrentDataFormatIndex = 0; // reset the list of dataformats we are reading DataFormatList = CurrentArray.getDataFormatList(); } XMLDataIOStyle readObj = CurrentArray.getXMLDataIOStyle(); FastestAxis = (AxisInterface) CurrentArray.getAxisList().get(0); LastFastAxisCoordinate = -1; if ( readObj instanceof TaggedXMLDataIOStyle) { TaggedLocatorObj = CurrentArray.createLocator(); } else { // A safety. We clear datablock when this is the first datanode we // have entered DATABLOCK is used in cases where we read in untagged data if (DataNodeLevel == 0) DATABLOCK = new StringBuffer (); } // entered a datanode, raise the count // this (partially helps) declare we are now reading data, DataNodeLevel++; return readObj; } |
|
XDF.setXMLNotationHash(Notation); | public void endDocument() throws SAXException { // do nothing, method required by interface } |
|
printJob.setPrintable (this); | printJob.setPrintable (this,pf); | public void run () {// Toolkit tk = Toolkit.getDefaultToolkit();//int [][] range = new int[][] {//new int[] { 1, 1 }//};// JobAttributes jobAttributes = new JobAttributes(1, JobAttributes.DefaultSelectionType.ALL, JobAttributes.DestinationType.PRINTER, JobAttributes.DialogType.NONE, "file", 1, 1, JobAttributes.MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES, range, "HP LaserJet", JobAttributes.SidesType.ONE_SIDED);//PrintJob job = tk.getPrintJob(null, "Print", jobAttributes, null);//if (job != null) { //--- Create a printerJob object PrinterJob printJob = PrinterJob.getPrinterJob (); printJob.setJobName("tn5250j"); //--- Set the printable class to this one since we //--- are implementing the Printable interface printJob.setPrintable (this); // set the cursor back session.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); //--- Show a print dialog to the user. If the user //--- clicks the print button, then print, otherwise //--- cancel the print job if (printJob.printDialog()) { try { // we do this because of loosing focus with jdk 1.4.0 session.requestFocus(); printJob.print(); } catch (Exception PrintException) { PrintException.printStackTrace(); } } else { // we do this because of loosing focus with jdk 1.4.0 session.requestFocus(); } session = null; int len = screen.length; for (int x = 0; x < len; x++) { screen[x] = null; } screen = null; } |
AbstractButton.this.fireStateChanged(); repaint(); | public void stateChanged(ChangeEvent ev) { } |
|
return new ChangeListener() { public void stateChanged(ChangeEvent e) { AbstractButton.this.fireStateChanged(); AbstractButton.this.repaint(); } }; | return new ButtonChangeListener(); | protected ChangeListener createChangeListener() { return new ChangeListener() { public void stateChanged(ChangeEvent e) { AbstractButton.this.fireStateChanged(); AbstractButton.this.repaint(); } }; } |
if (b == isEnabled()) return; | public void setEnabled(boolean b) { super.setEnabled(b); ButtonModel mod = getModel(); if (mod != null) mod.setEnabled(b); } |
|
viewport.setBounds(new Rectangle(x2, y2, x3 - x2, y3 - y2)); | viewport.setBounds(new Rectangle(x2 + vpi.left, y2 + vpi.top, x3 - x2 - vpi.left - vpi.right, y3 - y2 - vpi.top - vpi.bottom)); | public void layoutContainer(Container parent) { // Sun's implementation simply throws a ClassCastException if // parent is no JScrollPane, so do we. JScrollPane sc = (JScrollPane) parent; JViewport viewport = sc.getViewport(); Component view = viewport.getView(); // If there is no view in the viewport, there is no work to be done. if (view == null) return; Dimension viewSize = viewport.getView().getPreferredSize(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); int vsWidth = 0; int hsHeight = 0; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y4 - y2))); if (showVsb) vsWidth = vsb.getPreferredSize().width; // The horizontal scroll bar may become necessary if the vertical scroll // bar appears, reducing the space, left for the component. boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x4 - x2 - vsWidth))); if (showHsb) hsHeight = hsb.getPreferredSize().height; // If the horizontal scroll bar appears, and the vertical scroll bar // was not necessary assuming that there is no horizontal scroll bar, // the vertical scroll bar may become necessary because the horizontal // scroll bar reduces the vertical space for the component. if (!showVsb) { showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y4 - y2))); if (showVsb) vsWidth = vsb.getPreferredSize().width; } x3 = x4 - vsWidth; y3 = y4 - hsHeight; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3 - x2, y3 - y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3 - x2, y2 - y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2 - x1, y3 - y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4 - x3, y3 - y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3 - x2, y4 - y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2 - x1, y2 - y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4 - x3, y2 - y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2 - x1, y4 - y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4 - x3, y4 - y3)); } |
Border vpBorder = sc.getViewportBorder(); if (vpBorder != null) { i = vpBorder.getBorderInsets(sc); width += i.left + i.right; height += i.top + i.bottom; } | public Dimension minimumLayoutSize(Container parent) { // Sun's implementation simply throws a ClassCastException if // parent is no JScrollPane, so do we. JScrollPane sc = (JScrollPane) parent; Insets i = sc.getInsets(); Dimension viewportMinSize = sc.getViewport().getMinimumSize(); int width = i.left + i.right + viewportMinSize.width; if (sc.getVerticalScrollBarPolicy() != JScrollPane.VERTICAL_SCROLLBAR_NEVER) width += sc.getVerticalScrollBar().getMinimumSize().width; int height = i.top + i.bottom + viewportMinSize.height; if (sc.getHorizontalScrollBarPolicy() != JScrollPane.HORIZONTAL_SCROLLBAR_NEVER) height += sc.getHorizontalScrollBar().getMinimumSize().height; return new Dimension(width, height); } |
|
Border vpBorder = sc.getViewportBorder(); if (vpBorder != null) { Insets i = vpBorder.getBorderInsets(sc); width += i.left + i.right; height += i.top + i.bottom; } | public Dimension preferredLayoutSize(Container parent) { // Sun's implementation simply throws a ClassCastException if // parent is no JScrollPane, so do we. JScrollPane sc = (JScrollPane) parent; Dimension viewportSize = viewport.getPreferredSize(); Dimension viewSize = viewport.getViewSize(); int width = viewportSize.width; int height = viewportSize.height; // horizontal scrollbar needed if the view's preferred width // is larger than the viewport's preferred width if (hsb != null && viewSize.width > viewportSize.width) height += hsb.getPreferredSize().height; // vertical scrollbar needed if the view's preferred height // is larger than the viewport's preferred height if (vsb != null && viewSize.height > viewportSize.height) width += vsb.getPreferredSize().width; if (rowHead != null && rowHead.isVisible()) width += rowHead.getPreferredSize().width; if (colHead != null && colHead.isVisible()) height += colHead.getPreferredSize().height; Insets i = sc.getInsets(); return new Dimension(width + i.left + i.right, height + i.left + i.right); } |
|
super.fireVetoableChange(name, new Boolean(oldValue), new Boolean(newValue)); | super.fireVetoableChange(name, Boolean.valueOf(oldValue), Boolean.valueOf(newValue)); | private void fireVetoableChange(String name, boolean oldValue, boolean newValue) throws PropertyVetoException { super.fireVetoableChange(name, new Boolean(oldValue), new Boolean(newValue)); } |
static final void applicationProcessorMain() { | static final void applicationProcessorMain() throws PragmaLoadStatics { | static final void applicationProcessorMain() { final VmX86Processor cpu = (VmX86Processor)Unsafe.getCurrentProcessor(); BootLog.info("Starting Application Processor " + cpu.getId()); // First force a load of CPUID cpu.getCPUID(); // Detect and start logical CPU's try { detectAndstartLogicalProcessors(cpu.rm); } catch (ResourceNotFreeException ex) { BootLog.error("Cannot detect logical processors", ex); } // TODO do something useful. } |
gdt.dump(System.out); | private final void setupStructures() { // Clone GDT this.gdt = new GDT(); gdt.setBase(GDT.PROCESSOR_ENTRY, Address.valueOf(this)); // Clone TSS this.tss = new TSS(); gdt.setBase(GDT.TSS_ENTRY, tss.getAddress()); // Create kernel stack tss.setKernelStack(new byte[VmThread.DEFAULT_STACK_SIZE]); // Create user stack final byte[] userStack = new byte[VmThread.DEFAULT_STACK_SIZE]; tss.setUserStack(userStack); this.currentThread = new VmX86Thread(userStack); gdt.dump(System.out); } |
|
BootLog.info("Not busy"); | final void startup(ResourceManager rm) throws ResourceNotFreeException { // Save resource manager, so when this processor starts, it can be // used right away. this.rm = rm; final VmProcessor me = Unsafe.getCurrentProcessor(); BootLog.info("Startup of 0x" + NumberUtils.hex(getId(), 2) + " from " + NumberUtils.hex(me.getId(), 2)); // Setup kernel structures setupStructures(); // Setup the boot code setupBootCode(rm); // Make sure APIC is enabled (the apic of the current CPU!) BootLog.info("Enabling APIC current state " + apic.isEnabled()); apic.setEnabled(true); apic.clearErrors(); //TimeUtils.loop(5000); // Send INIT IPI BootLog.info("Sending INIT IPI"); apic.sendInitIPI(getId(), true); apic.loopUntilNotBusy(); TimeUtils.loop(10); // Send INIT-DeAssert IPI BootLog.info("Sending INIT-DeAssert IPI"); apic.sendInitIPI(getId(), false); apic.loopUntilNotBusy(); TimeUtils.loop(10); final int numStarts = 2; for (int i = 0; i < numStarts; i++) { // Send STARTUP IPI BootLog.info("Sending STARTUP IPI"); apic.clearErrors(); apic.sendStartupIPI(getId(), bootCode.getAddress()); apic.loopUntilNotBusy(); BootLog.info("Not busy"); TimeUtils.loop(100); apic.clearErrors(); } BootLog.info("loop 5000"); TimeUtils.loop(5000); } |
|
BootLog.info("loop 5000"); TimeUtils.loop(5000); | final void startup(ResourceManager rm) throws ResourceNotFreeException { // Save resource manager, so when this processor starts, it can be // used right away. this.rm = rm; final VmProcessor me = Unsafe.getCurrentProcessor(); BootLog.info("Startup of 0x" + NumberUtils.hex(getId(), 2) + " from " + NumberUtils.hex(me.getId(), 2)); // Setup kernel structures setupStructures(); // Setup the boot code setupBootCode(rm); // Make sure APIC is enabled (the apic of the current CPU!) BootLog.info("Enabling APIC current state " + apic.isEnabled()); apic.setEnabled(true); apic.clearErrors(); //TimeUtils.loop(5000); // Send INIT IPI BootLog.info("Sending INIT IPI"); apic.sendInitIPI(getId(), true); apic.loopUntilNotBusy(); TimeUtils.loop(10); // Send INIT-DeAssert IPI BootLog.info("Sending INIT-DeAssert IPI"); apic.sendInitIPI(getId(), false); apic.loopUntilNotBusy(); TimeUtils.loop(10); final int numStarts = 2; for (int i = 0; i < numStarts; i++) { // Send STARTUP IPI BootLog.info("Sending STARTUP IPI"); apic.clearErrors(); apic.sendStartupIPI(getId(), bootCode.getAddress()); apic.loopUntilNotBusy(); BootLog.info("Not busy"); TimeUtils.loop(100); apic.clearErrors(); } BootLog.info("loop 5000"); TimeUtils.loop(5000); } |
|
String str = (String)constraints; if (str == null || str.equals(CENTER)) center = component; else if (str.equals(NORTH)) north = component; else if (str.equals(SOUTH)) south = component; else if (str.equals(EAST)) east = component; else if (str.equals(WEST)) west = component; else if (str.equals(BEFORE_FIRST_LINE)) firstLine = component; else if (str.equals(AFTER_LAST_LINE)) lastLine = component; else if (str.equals(BEFORE_LINE_BEGINS)) firstItem = component; else if (str.equals(AFTER_LINE_ENDS)) lastItem = component; else throw new IllegalArgumentException("Constraint value not valid: " + str); | addLayoutComponent((String) constraints, component); | addLayoutComponent(Component component, Object constraints){ if (constraints != null && ! (constraints instanceof String)) throw new IllegalArgumentException("Constraint must be a string"); String str = (String)constraints; if (str == null || str.equals(CENTER)) center = component; else if (str.equals(NORTH)) north = component; else if (str.equals(SOUTH)) south = component; else if (str.equals(EAST)) east = component; else if (str.equals(WEST)) west = component; else if (str.equals(BEFORE_FIRST_LINE)) firstLine = component; else if (str.equals(AFTER_LAST_LINE)) lastLine = component; else if (str.equals(BEFORE_LINE_BEGINS)) firstItem = component; else if (str.equals(AFTER_LINE_ENDS)) lastItem = component; else throw new IllegalArgumentException("Constraint value not valid: " + str);} |
if (comp == null) | if (comp == null || !comp.isVisible()) | calcCompSize(Component comp, int what){ if (comp == null) return new Dimension(0, 0); if (what == MIN) return comp.getMinimumSize(); else if (what == MAX) return comp.getMaximumSize(); return comp.getPreferredSize();} |
int x3 = t.width - i.right - e.width; | int x3 = Math.max(x2 + w.width + hgap, t.width - i.right - e.width); | layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + hgap; int x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + vgap; int y3 = t.height - i.bottom - s.height; int hh = y3-y2-vgap; setBounds(center, x2, y2, x3-x2-hgap, hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }} |
int y3 = t.height - i.bottom - s.height; | int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3 = Math.max(y2 + midh + vgap, t.height - i.bottom - s.height); | layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + hgap; int x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + vgap; int y3 = t.height - i.bottom - s.height; int hh = y3-y2-vgap; setBounds(center, x2, y2, x3-x2-hgap, hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }} |
public void keyPressed(KeyEvent e) | public void keyPressed(KeyEvent evt) | public void keyPressed(KeyEvent e) { } |
else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) { } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { } else if (evt.getKeyCode() == KeyEvent.VK_TAB) { } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) { if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; } if (rowLead == rowModel.getMaxSelectionIndex()) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); if (colLead == colModel.getMaxSelectionIndex()) colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); else { int[] colsSelected = table.getSelectedColumns(); int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } } else { int[] rowsSelected = table.getSelectedRows(); int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax); rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } } | public void keyPressed(KeyEvent e) { } |
|
if (table.getRowSelectionAllowed()) { | private void updateSelection(boolean controlPressed) { if (table.getRowSelectionAllowed()) { int lo_row = table.rowAtPoint(begin); int hi_row = table.rowAtPoint(curr); ListSelectionModel rowModel = table.getSelectionModel(); if (lo_row != -1 && hi_row != -1) { if (controlPressed && rowModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) rowModel.addSelectionInterval(lo_row, hi_row); else rowModel.setSelectionInterval(lo_row, hi_row); } } if (table.getColumnSelectionAllowed()) { int lo_col = table.columnAtPoint(begin); int hi_col = table.columnAtPoint(curr); ListSelectionModel colModel = table.getColumnModel(). getSelectionModel(); if (lo_col != -1 && hi_col != -1) { if (controlPressed && colModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) colModel.addSelectionInterval(lo_col, hi_col); else colModel.setSelectionInterval(lo_col, hi_col); } } } |
|
} | private void updateSelection(boolean controlPressed) { if (table.getRowSelectionAllowed()) { int lo_row = table.rowAtPoint(begin); int hi_row = table.rowAtPoint(curr); ListSelectionModel rowModel = table.getSelectionModel(); if (lo_row != -1 && hi_row != -1) { if (controlPressed && rowModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) rowModel.addSelectionInterval(lo_row, hi_row); else rowModel.setSelectionInterval(lo_row, hi_row); } } if (table.getColumnSelectionAllowed()) { int lo_col = table.columnAtPoint(begin); int hi_col = table.columnAtPoint(curr); ListSelectionModel colModel = table.getColumnModel(). getSelectionModel(); if (lo_col != -1 && hi_col != -1) { if (controlPressed && colModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) colModel.addSelectionInterval(lo_col, hi_col); else colModel.setSelectionInterval(lo_col, hi_col); } } } |
|
if (table.getColumnSelectionAllowed()) { | private void updateSelection(boolean controlPressed) { if (table.getRowSelectionAllowed()) { int lo_row = table.rowAtPoint(begin); int hi_row = table.rowAtPoint(curr); ListSelectionModel rowModel = table.getSelectionModel(); if (lo_row != -1 && hi_row != -1) { if (controlPressed && rowModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) rowModel.addSelectionInterval(lo_row, hi_row); else rowModel.setSelectionInterval(lo_row, hi_row); } } if (table.getColumnSelectionAllowed()) { int lo_col = table.columnAtPoint(begin); int hi_col = table.columnAtPoint(curr); ListSelectionModel colModel = table.getColumnModel(). getSelectionModel(); if (lo_col != -1 && hi_col != -1) { if (controlPressed && colModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) colModel.addSelectionInterval(lo_col, hi_col); else colModel.setSelectionInterval(lo_col, hi_col); } } } |
|
doInput = true; | public Connection(URL url) { super (url); permission = new FilePermission(getURL().getFile(), DEFAULT_PERMISSION); } |
|
throw new BAD_OPERATION(method, 0, CompletionStatus.COMPLETED_MAYBE); | throw new BAD_OPERATION(method, Minor.Method, CompletionStatus.COMPLETED_MAYBE); | public final OutputStream _invoke(String method, InputStream input, ResponseHandler rh ) { OutputStream output = null; if (method.equals("destroy")) { // The "destroy" has been invoked. destroy(); output = rh.createReply(); } else if (method.equals("copy")) { // The "copy" has been invoked. org.omg.CORBA.Object returns = copy(); output = rh.createReply(); output.write_Object(this); } else if (method.equals("policy_type")) { // The "policy_type" has been invoked. int returns = policy_type(); output = rh.createReply(); output.write_long(returns); } else if (method.equals("value")) { // The "value" can be invoked on the children types // and must return an integer, representing the policy value // (CORBA enumeration). output = rh.createReply(); output.write_long(policyCode); } else throw new BAD_OPERATION(method, 0, CompletionStatus.COMPLETED_MAYBE); return output; } |
public FatLfnDirectory(FatFileSystem fs, int nrEntries) { super(fs, nrEntries); | public FatLfnDirectory(FatFileSystem fs, FatFile file) throws IOException { super(fs, file); | public FatLfnDirectory(FatFileSystem fs, int nrEntries) { super(fs, nrEntries); } |
public synchronized void write(BlockDeviceAPI device, long offset) throws IOException { | protected synchronized void write() throws IOException { | public synchronized void write(BlockDeviceAPI device, long offset) throws IOException { if (label != null) applyLabel(); final byte[] data = new byte[entries.size() * 32]; write(data); device.write(offset, data, 0, data.length); resetDirty(); } |
device.write(offset, data, 0, data.length); | file.write(0, data, 0, data.length); | public synchronized void write(BlockDeviceAPI device, long offset) throws IOException { if (label != null) applyLabel(); final byte[] data = new byte[entries.size() * 32]; write(data); device.write(offset, data, 0, data.length); resetDirty(); } |
defaults.put("List.focusCellHighlightBorder", new LineBorderUIResource(getPrimary1())); | public void addCustomEntriesToTable(UIDefaults defaults) { // Gradients. defaults.put("Button.gradient", Arrays.asList(new Object[] {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243), new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)})); defaults.put("CheckBox.gradient", Arrays.asList(new Object[] {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243), new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)})); defaults.put("CheckBoxMenuItem.gradient", Arrays.asList(new Object[] {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243), new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)})); defaults.put("MenuBar.gradient", Arrays.asList(new Object[] {new Float(1.0), new Float(0.0), new ColorUIResource(Color.WHITE), new ColorUIResource(218, 218, 218), new ColorUIResource(218, 218, 218)})); defaults.put("RadioButton.gradient", Arrays.asList(new Object[] {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243), new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)})); defaults.put("RadioButtonMenuItem.gradient", Arrays.asList(new Object[] {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243), new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)})); defaults.put("ScrollBar.gradient", Arrays.asList(new Object[] {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243), new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)})); defaults.put("Slider.gradient", Arrays.asList(new Object[] {new Float(0.3), new Float(0.2), new ColorUIResource(200, 221, 242), new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)})); defaults.put("Slider.focusGradient", Arrays.asList(new Object[] {new Float(0.3), new Float(0.2), new ColorUIResource(200, 221, 242), new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)})); defaults.put("ToggleButton.gradient", Arrays.asList(new Object[] {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243), new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)})); defaults.put("InternalFrame.activeTitleGradient", Arrays.asList(new Object[] {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243), new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)})); // Colors. ColorUIResource c1 = new ColorUIResource(200, 221, 242); ColorUIResource c2 = new ColorUIResource(153, 153, 153); ColorUIResource c3 = new ColorUIResource(204, 204, 204); ColorUIResource c4 = new ColorUIResource(210, 226, 239); ColorUIResource c5 = new ColorUIResource(218, 218, 218); defaults.put("Button.disabledToolBarBorderBackground", c3); defaults.put("Button.toolBarBorderBackground", c2); defaults.put("Label.disabledForeground", c2); defaults.put("MenuBar.borderColor", c3); defaults.put("Slider.altTrackColor", c4); defaults.put("SplitPane.dividerFocusColor", c1); defaults.put("TabbedPane.contentAreaColor", c1); defaults.put("TabbedPane.borderHightlightColor", PRIMARY1); defaults.put("TabbedPane.selected", c1); defaults.put("TabbedPane.tabAreaBackground", c5); defaults.put("TabbedPane.unselectedBackground", SECONDARY3); defaults.put("Table.gridColor", SECONDARY1); defaults.put("ToolBar.borderColor", c3); defaults.put("Tree.selectionBorderColor", PRIMARY1); // Borders. defaults.put("Table.focusCellHighlightBorder", new LineBorderUIResource(getPrimary1())); // Insets. defaults.put("TabbedPane.contentBorderInsets", new Insets(4, 2, 3, 3)); defaults.put("TabbedPane.tabAreaInsets", new Insets(2, 2, 0, 6)); // Flags. defaults.put("SplitPane.oneTouchButtonsOpaque", Boolean.FALSE); defaults.put("Menu.opaque", Boolean.FALSE); defaults.put("ToolBar.isRollover", Boolean.TRUE); defaults.put("RadioButton.rollover", Boolean.TRUE); defaults.put("CheckBox.rollover", Boolean.TRUE); defaults.put("Button.rollover", Boolean.TRUE); // Icons. // FIXME: Add OceanTheme icons.// defaults.put("Tree.leafIcon", XXX);// defaults.put("Tree.expandedIcon", XXX);// defaults.put("Tree.openIcon", XXX);// defaults.put("Tree.closedIcon", XXX);// defaults.put("Tree.collapsedIcon", XXX);// defaults.put("FileChooser.newFolderIcon", XXX);// defaults.put("FileChooser.homeFolderIcon", XXX);// defaults.put("FileChooser.upFolderIcon", XXX);// defaults.put("FileView.hardDriveIcon", XXX);// defaults.put("FileView.floppyDriveIcon", XXX);// defaults.put("FileView.fileIcon", XXX);// defaults.put("FileView.computerIcon", XXX);// defaults.put("FileView.directoryIcon", XXX);// defaults.put("OptionPane.questionIcon", XXX);// defaults.put("OptionPane.errorIcon", XXX);// defaults.put("OptionPane.warningIcon", XXX);// defaults.put("OptionPane.informationIcon", XXX);// defaults.put("InternalFrame.icon", XXX);// defaults.put("InternalFrame.closeIcon", XXX);// defaults.put("InternalFrame.iconifyIcon", XXX);// defaults.put("InternalFrame.minimizeIcon", XXX);// defaults.put("InternalFrame.maximizeIcon", XXX);// defaults.put("InternalFrame.paletteCloseIcon", XXX); // UI classes. defaults.put("MenuBarUI", "javax.swing.plaf.metal.MetalMenuBarUI"); // Others. defaults.put("Button.rolloverIconType", "ocean"); } |
|
if (accessibleContext == null) accessibleContext = new AccessibleBoxFiller(); | public AccessibleContext getAccessibleContext() { // FIXME: disable to make libjava compile; visibility rules are broken // if (accessibleContext == null) // accessibleContext = new AccessibleBoxFiller(); return accessibleContext; } |
|
if (accessibleContext == null) accessibleContext = new AccessibleBox(); | public AccessibleContext getAccessibleContext() { // if (accessibleContext == null) // accessibleContext = new AccessibleBox(); return accessibleContext; } |
|
if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); } else { | private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false); setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(true); loadProps(); screen = new Screen5250(this,defaultProps); this.addComponentListener(this); if (!defaultProps.containsKey("width") || !defaultProps.containsKey("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(Integer.parseInt((String)defaultProps.get("width")), Integer.parseInt((String)defaultProps.get("height")) ); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } } }); addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { processVTKeyTyped(e); } public void keyPressed(KeyEvent ke) { processVTKeyPressed(ke); } public void keyReleased(KeyEvent e) { processVTKeyReleased(e); } }); keyMap = new KeyMapper(); keyMap.init(); /** * this is taken out right now look at the method for description */// initKeyBindings(); macros = new Macronizer(); macros.init(); keyPad.addActionListener(this); if (getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); jumpEvent = new SessionJumpEvent(this); } |
|
} | private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false); setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(true); loadProps(); screen = new Screen5250(this,defaultProps); this.addComponentListener(this); if (!defaultProps.containsKey("width") || !defaultProps.containsKey("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(Integer.parseInt((String)defaultProps.get("width")), Integer.parseInt((String)defaultProps.get("height")) ); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } } }); addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { processVTKeyTyped(e); } public void keyPressed(KeyEvent ke) { processVTKeyPressed(ke); } public void keyReleased(KeyEvent e) { processVTKeyReleased(e); } }); keyMap = new KeyMapper(); keyMap.init(); /** * this is taken out right now look at the method for description */// initKeyBindings(); macros = new Macronizer(); macros.init(); keyPad.addActionListener(this); if (getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); jumpEvent = new SessionJumpEvent(this); } |
|
if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); } else { | public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } } |
|
} | public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } } |
|
Session s = manager.openSession(sesProps,"","Test Applet"); s.grabFocus(); | final Session s = manager.openSession(sesProps,"","Test Applet"); | private void jbInit() throws Exception { this.setSize(new Dimension(400,300)); Properties sesProps = new Properties(); // Start loading properties - Host must exist sesProps.put(SESSION_HOST,getParameter("host")); if (isSpecified("-e")) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p")) { sesProps.put(SESSION_HOST_PORT,getParameter("-p")); }// if (isSpecified("-f",args))// propFileName = getParm("-f",args); if (isSpecified("-cp")) sesProps.put(SESSION_CODE_PAGE ,getParameter("-cp")); if (isSpecified("-gui")) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132")) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // socks proxy host argument if (isSpecified("-sph")) { sesProps.put(SESSION_PROXY_HOST ,getParameter("-sph")); } // socks proxy port argument if (isSpecified("-spp")) sesProps.put(SESSION_PROXY_PORT ,getParameter("-spp")); // check if device name is specified if (isSpecified("-dn")) sesProps.put(SESSION_DEVICE_NAME ,getParameter("-dn")); if (isSpecified("-L")) LangTool.init(parseLocale(getParameter("-L"))); else LangTool.init(); manager = new SessionManager(); Session s = manager.openSession(sesProps,"","Test Applet"); s.grabFocus(); this.getContentPane().add(s); s.connect(); } |
SwingUtilities.invokeLater(new Runnable() { public void run() { s.grabFocus(); } }); | private void jbInit() throws Exception { this.setSize(new Dimension(400,300)); Properties sesProps = new Properties(); // Start loading properties - Host must exist sesProps.put(SESSION_HOST,getParameter("host")); if (isSpecified("-e")) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p")) { sesProps.put(SESSION_HOST_PORT,getParameter("-p")); }// if (isSpecified("-f",args))// propFileName = getParm("-f",args); if (isSpecified("-cp")) sesProps.put(SESSION_CODE_PAGE ,getParameter("-cp")); if (isSpecified("-gui")) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132")) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // socks proxy host argument if (isSpecified("-sph")) { sesProps.put(SESSION_PROXY_HOST ,getParameter("-sph")); } // socks proxy port argument if (isSpecified("-spp")) sesProps.put(SESSION_PROXY_PORT ,getParameter("-spp")); // check if device name is specified if (isSpecified("-dn")) sesProps.put(SESSION_DEVICE_NAME ,getParameter("-dn")); if (isSpecified("-L")) LangTool.init(parseLocale(getParameter("-L"))); else LangTool.init(); manager = new SessionManager(); Session s = manager.openSession(sesProps,"","Test Applet"); s.grabFocus(); this.getContentPane().add(s); s.connect(); } |
|
throw new Error("Not implemented"); | return new URLAudioClip(url); | public static final AudioClip newAudioClip(URL url) { // This requires an implementation of AudioClip in gnu.java.applet. throw new Error("Not implemented"); } |
return super.paramString(); | StringBuffer sb = new StringBuffer(super.paramString()); sb.append(",defaultIcon="); if (icon != null) sb.append(icon); sb.append(",disabledIcon="); if (disabledIcon != null) sb.append(disabledIcon); sb.append(",horizontalAlignment="); sb.append(SwingUtilities.convertHorizontalAlignmentCodeToString( horizontalAlignment)); sb.append(",horizontalTextPosition="); sb.append(SwingUtilities.convertHorizontalAlignmentCodeToString( horizontalTextPosition)); sb.append(",iconTextGap=").append(iconTextGap); sb.append(",labelFor="); if (labelFor != null) sb.append(labelFor); sb.append(",text="); if (text != null) sb.append(text); sb.append(",verticalAlignment="); sb.append(SwingUtilities.convertVerticalAlignmentCodeToString( verticalAlignment)); sb.append(",verticalTextPosition="); sb.append(SwingUtilities.convertVerticalAlignmentCodeToString( verticalTextPosition)); return sb.toString(); | protected String paramString() { return super.paramString(); } |
Component oldLabelFor = labelFor; | public void setLabelFor(Component c) { if (c != labelFor) { // We put the label into the client properties for the labeled // component so that it can be read by the AccessibleJComponent. // The other option would be to reserve a default visible field // in JComponent, but since this is relativly seldomly used, it // would be unnecessary waste of memory to do so. Component oldLabelFor = labelFor; if (oldLabelFor instanceof JComponent) { ((JComponent) oldLabelFor).putClientProperty(LABEL_PROPERTY, null); } labelFor = c; if (labelFor instanceof JComponent) { ((JComponent) labelFor).putClientProperty(LABEL_PROPERTY, this); } firePropertyChange("labelFor", oldLabelFor, labelFor); } } |
|
labelFor = c; | public void setLabelFor(Component c) { if (c != labelFor) { // We put the label into the client properties for the labeled // component so that it can be read by the AccessibleJComponent. // The other option would be to reserve a default visible field // in JComponent, but since this is relativly seldomly used, it // would be unnecessary waste of memory to do so. Component oldLabelFor = labelFor; if (oldLabelFor instanceof JComponent) { ((JComponent) oldLabelFor).putClientProperty(LABEL_PROPERTY, null); } labelFor = c; if (labelFor instanceof JComponent) { ((JComponent) labelFor).putClientProperty(LABEL_PROPERTY, this); } firePropertyChange("labelFor", oldLabelFor, labelFor); } } |
|
firePropertyChange("labelFor", oldLabelFor, labelFor); | public void setLabelFor(Component c) { if (c != labelFor) { // We put the label into the client properties for the labeled // component so that it can be read by the AccessibleJComponent. // The other option would be to reserve a default visible field // in JComponent, but since this is relativly seldomly used, it // would be unnecessary waste of memory to do so. Component oldLabelFor = labelFor; if (oldLabelFor instanceof JComponent) { ((JComponent) oldLabelFor).putClientProperty(LABEL_PROPERTY, null); } labelFor = c; if (labelFor instanceof JComponent) { ((JComponent) labelFor).putClientProperty(LABEL_PROPERTY, this); } firePropertyChange("labelFor", oldLabelFor, labelFor); } } |
|
protected AbstractDirectory(FatFileSystem fs, FatFile myFile) { this(fs, (int)myFile.getLength() / 32, myFile); | protected AbstractDirectory(FatFileSystem fs, int nrEntries) { super(fs); entries.setSize(nrEntries); _dirty = false; | protected AbstractDirectory(FatFileSystem fs, FatFile myFile) { this(fs, (int)myFile.getLength() / 32, myFile); } |
int len = sortKeys.size(); | int len = sortKeys != null ? sortKeys.size() : 0; | TemplateNode clone(Stylesheet stylesheet) { int len = sortKeys.size(); List sortKeys2 = new ArrayList(len); for (int i = 0; i < len; i++) sortKeys2.add(((Key) sortKeys.get(i)).clone(stylesheet)); len = withParams.size(); List withParams2 = new ArrayList(len); for (int i = 0; i < len; i++) withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet)); TemplateNode ret = new ApplyTemplatesNode(select.clone(stylesheet), mode, sortKeys2, withParams2, isDefault); if (children != null) ret.children = children.clone(stylesheet); if (next != null) ret.next = next.clone(stylesheet); return ret; } |
exp = exp.replaceAll("%"+(i + 1), params[i]); | String par = params[i]; par = (par == null) ? "" : par.trim(); exp = exp.replaceAll("%"+(i + 1), par); | public String expand(String[] params){ //if(paramCount != params.length) return null; String exp = body; for(int i = 0; i < localLabels.length; i++){ exp = exp.replaceAll(localLabels[i], "__jnasm_macro_local_label_" + localLabelCount ++); } for(int i = 0; i < params.length; i++){ exp = exp.replaceAll("%"+(i + 1), params[i]); } if(maxParamCount > params.length){ if(defaultValues == null){ for(int i = params.length; i < maxParamCount; i++){ exp = exp.replaceAll("%"+(i + 1), ""); } }else{ for(int i = params.length; i < maxParamCount; i++){ if(defaultValues.length > i - params.length){ exp = exp.replaceAll("%"+(i + 1), defaultValues[i - params.length]); }else{ exp = exp.replaceAll("%"+(i + 1), ""); } } } } return exp; } |
exp = exp.replaceAll("%"+(i + 1), defaultValues[i - params.length]); | String def = defaultValues[i - params.length]; def = (def == null) ? "" : def.trim(); exp = exp.replaceAll("%"+(i + 1), def); | public String expand(String[] params){ //if(paramCount != params.length) return null; String exp = body; for(int i = 0; i < localLabels.length; i++){ exp = exp.replaceAll(localLabels[i], "__jnasm_macro_local_label_" + localLabelCount ++); } for(int i = 0; i < params.length; i++){ exp = exp.replaceAll("%"+(i + 1), params[i]); } if(maxParamCount > params.length){ if(defaultValues == null){ for(int i = params.length; i < maxParamCount; i++){ exp = exp.replaceAll("%"+(i + 1), ""); } }else{ for(int i = params.length; i < maxParamCount; i++){ if(defaultValues.length > i - params.length){ exp = exp.replaceAll("%"+(i + 1), defaultValues[i - params.length]); }else{ exp = exp.replaceAll("%"+(i + 1), ""); } } } } return exp; } |
public Boolean isTraversable(File value0) { return null; } | public Boolean isTraversable(File directory) { return null; } | public Boolean isTraversable(File value0) { return null; // TODO } // isTraversable() |
MenuComponent() { | public MenuComponent() { | MenuComponent(){ if (GraphicsEnvironment.isHeadless()) throw new HeadlessException ();} |
getFont() { | public Font getFont() { | getFont(){ if (font != null) return font; if (parent != null) return parent.getFont (); return null;} |
getName() { return(name); } | public String getName() { return name; } | getName(){ return(name);} |
getTreeLock() { return(tree_lock); } | protected final Object getTreeLock() { return tree_lock; } | getTreeLock(){ return(tree_lock);} |
{ return false; } | { boolean retVal = false; MenuContainer parent = getParent(); if (parent == null) { if (this instanceof MenuBar) { MenuBar menuBar = (MenuBar) this; if (menuBar.frame != null) retVal = menuBar.frame.postEvent(event); } } else retVal = parent.postEvent(event); return retVal; } | postEvent(Event event){ // This is overridden by subclasses that support events. return false;} |
setFont(Font font) { | public void setFont(Font font) { | setFont(Font font){ this.font = font;} |
setName(String name) { | public void setName(String name) { | setName(String name){ this.name = name; nameExplicitlySet = true;} |
setParent(MenuContainer parent) { | final void setParent(MenuContainer parent) { | setParent(MenuContainer parent){ this.parent = parent;} |
setTreeLock(Object tree_lock) { this.tree_lock = tree_lock; } | final void setTreeLock(Object treeLock) { this.tree_lock = treeLock; } | setTreeLock(Object tree_lock){ this.tree_lock = tree_lock;} |
toString() { return this.getClass().getName() + "[" + paramString() + "]"; } | public String toString() { return getClass().getName() + "[" + paramString() + "]"; } | toString(){ return this.getClass().getName() + "[" + paramString() + "]";} |
Accessible child = getAccessibleChild(index); if (child != null && child instanceof JMenuItem) { JMenuItem mi = (JMenuItem) child; MenuSelectionManager msm = MenuSelectionManager.defaultManager(); msm.setSelectedPath(createPath(JMenu.this)); } | public void addAccessibleSelection(int value0) throws NotImplementedException { // TODO: Implement this properly. } |
|
MenuSelectionManager msm = MenuSelectionManager.defaultManager(); MenuElement[] oldSelection = msm.getSelectedPath(); for (int i = 0; i < oldSelection.length; i++) { if (oldSelection[i] == JMenu.this) { MenuElement[] newSel = new MenuElement[i]; System.arraycopy(oldSelection, 0, newSel, 0, i); msm.setSelectedPath(newSel); break; } } | public void clearAccessibleSelection() throws NotImplementedException { // TODO: Implement this properly. } |
|
return null; | Component[] children = getMenuComponents(); int count = 0; Accessible found = null; for (int i = 0; i < children.length; i++) { if (children[i] instanceof Accessible) { if (count == index) { found = (Accessible) children[i]; break; } count++; } } return found; | public Accessible getAccessibleChild(int value0) throws NotImplementedException { return null; } |
return 0; | Component[] children = getMenuComponents(); int count = 0; for (int i = 0; i < children.length; i++) { if (children[i] instanceof Accessible) count++; } return count; | public int getAccessibleChildrenCount() throws NotImplementedException { return 0; } |
return 0; | int count = 0; MenuSelectionManager msm = MenuSelectionManager.defaultManager(); MenuElement[] me = msm.getSelectedPath(); if (me != null) { for (int i = 0; i < me.length; i++) { if (me[i] == JMenu.this) { if (i + 1 < me.length) { count = 1; break; } } } } return count; | public int getAccessibleSelectionCount() throws NotImplementedException { return 0; } |
return false; | boolean selected = false; MenuSelectionManager msm = MenuSelectionManager.defaultManager(); MenuElement[] me = msm.getSelectedPath(); if (me != null) { Accessible toBeFound = getAccessibleChild(index); for (int i = 0; i < me.length; i++) { if (me[i] == toBeFound) { selected = true; break; } } } return selected; | public boolean isAccessibleChildSelected(int value0) throws NotImplementedException { return false; } |
Accessible child = getAccessibleChild(index); if (child != null) { MenuSelectionManager msm = MenuSelectionManager.defaultManager(); MenuElement[] oldSelection = msm.getSelectedPath(); for (int i = 0; i < oldSelection.length; i++) { if (oldSelection[i] == child) { MenuElement[] newSel = new MenuElement[i - 1]; System.arraycopy(oldSelection, 0, newSel, 0, i - 1); msm.setSelectedPath(newSel); break; } } } | public void removeAccessibleSelection(int value0) throws NotImplementedException { // TODO: Implement this properly. } |
|
int pos = 0; | int pos = s.offset; | 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 current x and y pixel coordinates. int pixelX = x; int pixelY = y; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); int pixelWidth = 0; int pos = 0; int len = 0; for (int offset = s.offset; offset < (s.offset + s.count); ++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; } |
public synchronized void addNotify() { if (peer != null) { | addNotify() { if (peer != null) { | public synchronized void addNotify() { if (peer != null) { // This choice of toolkit seems unsatisfying, but I'm not sure // what else to do. peer = getToolkit().createCheckboxMenuItem(this); } super.addNotify(); } |
void dispatchEventImpl(AWTEvent e) { if (e.id <= ItemEvent.ITEM_LAST && e.id >= ItemEvent.ITEM_FIRST && (item_listeners != null || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) | dispatchEventImpl(AWTEvent e) { if (e.id <= ItemEvent.ITEM_LAST && e.id >= ItemEvent.ITEM_FIRST && (item_listeners != null || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) | void dispatchEventImpl(AWTEvent e) { if (e.id <= ItemEvent.ITEM_LAST && e.id >= ItemEvent.ITEM_FIRST && (item_listeners != null || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); } |
public Object[] getSelectedObjects() { | getSelectedObjects() { | public Object[] getSelectedObjects() { if (state == false) return (null); Object[] obj = new Object[1]; obj[0] = getLabel(); return (obj); } |
public boolean getState() { return (state); } | getState() { return(state); } | public boolean getState() { return (state); } |
public String paramString() { return ("label=" + getLabel() + ",state=" + state + "," + super.paramString()); } | paramString() { return ("label=" + getLabel() + ",state=" + state + "," + super.paramString()); } | public String paramString() { return ("label=" + getLabel() + ",state=" + state + "," + super.paramString()); } |
protected void processEvent(AWTEvent event) { | processEvent(AWTEvent event) { | protected void processEvent(AWTEvent event) { if (event instanceof ItemEvent) processItemEvent((ItemEvent) event); else super.processEvent(event); } |
protected void processItemEvent(ItemEvent event) { | processItemEvent(ItemEvent event) { | protected void processItemEvent(ItemEvent event) { if (item_listeners != null) item_listeners.itemStateChanged(event); } |
public synchronized void removeItemListener(ItemListener listener) { | removeItemListener(ItemListener listener) { | public synchronized void removeItemListener(ItemListener listener) { item_listeners = AWTEventMulticaster.remove(item_listeners, listener); } |
final Vm vm = new Vm(arch, null, cl.getStatics(), false); | final Vm vm = new Vm("?", arch, null, cl.getStatics(), false); | private void doExecute() throws BuildException, ClassNotFoundException, IllegalAccessException, IOException { final VmArchitecture arch = getArchitecture(); final int slotSize = arch.getReferenceSize(); VmSystemClassLoader cl = new VmSystemClassLoader(classesURL, arch); final Vm vm = new Vm(arch, null, cl.getStatics(), false); vm.toString(); // Just to avoid compiler warnings VmType.initializeForBootImage(cl); long lastModified = 0; FileWriter fw = new FileWriter(destFile); PrintWriter out = new PrintWriter(fw); out.println("; " + destFile.getPath()); out.println("; THIS file has been generated automatically on " + new Date()); out.println(); for (Iterator j = classes.iterator(); j.hasNext();) { final ClassName cn = (ClassName) j.next(); final URL classUrl = cn.getURL(classesURL); lastModified = Math.max(lastModified, classUrl.openConnection().getLastModified()); out.println("; Constants for " + cn.getClassName()); if (cn.isStatic()) { Class cls = Class.forName(cn.getClassName()); Field fields[] = cls.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { Field f = fields[i]; if (Modifier.isStatic(f.getModifiers()) && Modifier.isPublic(f.getModifiers())) { Object value = f.get(null); if (value instanceof Number) { String cname = cls.getName(); int idx = cname.lastIndexOf('.'); if (idx > 0) { cname = cname.substring(idx + 1); } String name = cname + "_" + f.getName(); out.println(name + " equ " + value); } } } out.println(); } else { out.println("; VmClass: " + cn.getClassName()); VmType vmClass = cl.loadClass(cn.getClassName(), true); vmClass.link(); String cname = vmClass.getName().replace('/', '.'); int idx = cname.lastIndexOf('.'); if (idx > 0) { cname = cname.substring(idx + 1); } int cnt = vmClass.getNoDeclaredFields(); for (int i = 0; i < cnt; i++) { final VmField f = vmClass.getDeclaredField(i); if (!f.isStatic()) { final VmInstanceField instF = (VmInstanceField) f; String name = cname + "_" + f.getName().toUpperCase() + "_OFFSET"; out.println(name + " equ " + (instF.getOffset() / slotSize)); } } // The size if (vmClass instanceof VmNormalClass) { final VmNormalClass cls = (VmNormalClass) vmClass; out.println(cname + "_SIZE equ " + cls.getObjectSize()); } // out.println(); } } out.flush(); fw.flush(); out.close(); fw.close(); destFile.setLastModified(lastModified); } |
} }; sendMenu.add(action); action = new AbstractAction(LangTool.getString("popup.toImage")) { public void actionPerformed(ActionEvent e) { sendMeToImageFile(); | private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getPosFromView(me.getX(),me.getY()); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(false); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { // get the bounded area of the selection screen.getBoundingArea(workR); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + workR.width); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + workR.height); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (keyHandler.isRecording()) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (Macronizer.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export")); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) { public void actionPerformed(ActionEvent e) { doMeSpool(); getFocusForMe(); } }; xtfrMenu.add(action); popup.add(xtfrMenu); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); GUIGraphicsUtils.positionPopup(me.getComponent(),popup, me.getX(),me.getY()); } |
|
doConnections(); } | sendMeToImageFile(); } | public void actionPerformed(ActionEvent e) { doConnections(); } |
changeConnection(); getFocusForMe(); } | doConnections(); } | public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } |
closeSession(); } | changeConnection(); getFocusForMe(); } | public void actionPerformed(ActionEvent e) { closeSession(); } |
if (((String)hm.getSelectedValue()).length() > 7) | if (((String)hm.getSelectedValue()).length() > 8) | private void showHexMap() { JPanel srp = new JPanel(); srp.setLayout(new BorderLayout()); DefaultListModel listModel = new DefaultListModel(); StringBuffer sb = new StringBuffer(); // we will use a collator here so that we can take advantage of the locales Collator collator = Collator.getInstance(); CollationKey key = null; Set set = new TreeSet(); for (int x =0;x < 256; x++) { char c = vt.ebcdic2uni(x);// char ac = vt.getASCIIChar(x); char ac = vt.ebcdic2uni(x); if (!Character.isISOControl(ac)) { sb.setLength(0); if (Integer.toHexString(ac).length() == 1){ sb.append("0x0" + Integer.toHexString(ac).toUpperCase()); } else { sb.append("0x" + Integer.toHexString(ac).toUpperCase()); } sb.append(" - " + c); key = collator.getCollationKey(sb.toString()); set.add(key); } } Iterator iterator = set.iterator(); while (iterator.hasNext()) { CollationKey keyc = (CollationKey)iterator.next(); listModel.addElement(keyc.getSourceString()); } //Create the list and put it in a scroll pane JList hm = new JList(listModel); hm.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); hm.setSelectedIndex(0); JScrollPane listScrollPane = new JScrollPane(hm); listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); listScrollPane.setSize(40,100); srp.add(listScrollPane,BorderLayout.CENTER); Object[] message = new Object[1]; message[0] = srp; String[] options = {LangTool.getString("hm.optInsert"), LangTool.getString("hm.optCancel")}; int result = 0; JFrame parent = (JFrame)SwingUtilities.getRoot(this); result = JOptionPane.showOptionDialog( parent, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("hm.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.INFORMATION_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 ); switch(result) { case 0: // Insert character String k = ""; if (((String)hm.getSelectedValue()).length() > 7) k += ((String)hm.getSelectedValue()).charAt(9); else k += ((String)hm.getSelectedValue()).charAt(7); screen.sendKeys(k); break; case 1: // Cancel// System.out.println("Cancel"); break; default: break; } } |
this.className = className; | this.declaringClass = className; | StackTraceElement(String fileName, int lineNumber, String className, String methodName, boolean isNative) { this.fileName = fileName; this.lineNumber = lineNumber; this.className = className; this.methodName = methodName; this.isNative = isNative; } |
&& equals(className, e.className) | && equals(declaringClass, e.declaringClass) | public boolean equals(Object o) { if (! (o instanceof StackTraceElement)) return false; StackTraceElement e = (StackTraceElement) o; return equals(fileName, e.fileName) && lineNumber == e.lineNumber && equals(className, e.className) && equals(methodName, e.methodName); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.