rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
bad.minor = Minor.Any; | public static TaggedProfile extract(Any any) { try { return ((TaggedProfileHolder) any.extract_Streamable()).value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("TaggedProfile expected"); bad.initCause(cex); throw bad; } } |
|
if (href !=null) writeOut(outputstream, " href = \"" + href + "\""); | if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) writeOut(outputstream, " href = \"" + href + "\""); String checksum = getChecksum(); if (checksum != null) writeOut(outputstream, " checksum = \"" + checksum.toString() + "\""); writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } |
if (checksum != null) writeOut(outputstream, " checksum = \"" + checksum.toString() + "\""); | if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) writeOut(outputstream, " href = \"" + href + "\""); String checksum = getChecksum(); if (checksum != null) writeOut(outputstream, " checksum = \"" + checksum.toString() + "\""); writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); } |
Ext2Debugger.error("BLOCK FLUSHED FROM CACHE",1); | log.error("BLOCK FLUSHED FROM CACHE"); | public void flush() { if(!dirty) return; //XXX... Ext2Debugger.error("BLOCK FLUSHED FROM CACHE",1); } |
return target.getAlignmentX(); | return 0.0F; | public float getLayoutAlignmentX(Container target) { return target.getAlignmentX(); } |
return target.getAlignmentY(); | return 0.0F; | public float getLayoutAlignmentY(Container target) { return target.getAlignmentY(); } |
synchronized (this) { glassPaneBounds = null; layeredPaneBounds = null; contentPaneBounds = null; menuBarBounds = null; prefSize = null; } | public void invalidateLayout(Container target) { // Nothing to do here. } |
|
Dimension menuBarSize; int containerWidth = c.getBounds().width - getInsets().left - getInsets().right; int containerHeight = c.getBounds().height - getInsets().top - getInsets().bottom; Dimension contentPaneSize = contentPane.getPreferredSize(); | if (glassPaneBounds == null || layeredPaneBounds == null || contentPaneBounds == null || menuBarBounds == null) { Insets i = getInsets(); int containerWidth = c.getBounds().width - i.left - i.right; int containerHeight = c.getBounds().height - i.top - i.bottom; | public void layoutContainer(Container c) { Dimension menuBarSize; int containerWidth = c.getBounds().width - getInsets().left - getInsets().right; int containerHeight = c.getBounds().height - getInsets().top - getInsets().bottom; Dimension contentPaneSize = contentPane.getPreferredSize(); // 1. the glassPane fills entire viewable region (bounds - insets). // 2. the layeredPane filles entire viewable region. // 3. the menuBar is positioned at the upper edge of layeredPane. // 4. the contentPane fills viewable region minus menuBar, if present. /* if size of top-level window wasn't set then just set contentPane and menuBar to its preferred sizes. Otherwise, if the size of top-level window was specified then set menuBar to its preferred size and make content pane to fit into the remaining space +-------------------------------+ | JLayeredPane | | +--------------------------+ | | | menuBar | | | +--------------------------+ | | +--------------------------+ | | |contentPane | | | | | | | | | | | | | | | +--------------------------+ | +-------------------------------+ */ if (containerWidth == 0 && containerHeight == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); menuBar.setBounds(0, 0, maxWidth, menuBarSize.height); glassPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); contentPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); layeredPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); } else { glassPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); contentPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); layeredPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); } } else { if (menuBar != null) { menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.height > containerHeight) menuBarSize.height = containerHeight; menuBar.setBounds(0, 0, containerWidth, menuBarSize.height); glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, menuBarSize.height, containerWidth, (containerHeight - menuBarSize.height)); } else { glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, 0, containerWidth, containerHeight); } layeredPane.setBounds(0, 0, containerWidth, containerHeight); } } |
/* if size of top-level window wasn't set then just set contentPane and menuBar to its preferred sizes. Otherwise, if the size of top-level window was specified then set menuBar to its preferred size and make content pane to fit into the remaining space | public void layoutContainer(Container c) { Dimension menuBarSize; int containerWidth = c.getBounds().width - getInsets().left - getInsets().right; int containerHeight = c.getBounds().height - getInsets().top - getInsets().bottom; Dimension contentPaneSize = contentPane.getPreferredSize(); // 1. the glassPane fills entire viewable region (bounds - insets). // 2. the layeredPane filles entire viewable region. // 3. the menuBar is positioned at the upper edge of layeredPane. // 4. the contentPane fills viewable region minus menuBar, if present. /* if size of top-level window wasn't set then just set contentPane and menuBar to its preferred sizes. Otherwise, if the size of top-level window was specified then set menuBar to its preferred size and make content pane to fit into the remaining space +-------------------------------+ | JLayeredPane | | +--------------------------+ | | | menuBar | | | +--------------------------+ | | +--------------------------+ | | |contentPane | | | | | | | | | | | | | | | +--------------------------+ | +-------------------------------+ */ if (containerWidth == 0 && containerHeight == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); menuBar.setBounds(0, 0, maxWidth, menuBarSize.height); glassPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); contentPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); layeredPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); } else { glassPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); contentPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); layeredPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); } } else { if (menuBar != null) { menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.height > containerHeight) menuBarSize.height = containerHeight; menuBar.setBounds(0, 0, containerWidth, menuBarSize.height); glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, menuBarSize.height, containerWidth, (containerHeight - menuBarSize.height)); } else { glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, 0, containerWidth, containerHeight); } layeredPane.setBounds(0, 0, containerWidth, containerHeight); } } |
|
+-------------------------------+ | JLayeredPane | | +--------------------------+ | | | menuBar | | | +--------------------------+ | | +--------------------------+ | | |contentPane | | | | | | | | | | | | | | | +--------------------------+ | +-------------------------------+ */ if (containerWidth == 0 && containerHeight == 0) { | public void layoutContainer(Container c) { Dimension menuBarSize; int containerWidth = c.getBounds().width - getInsets().left - getInsets().right; int containerHeight = c.getBounds().height - getInsets().top - getInsets().bottom; Dimension contentPaneSize = contentPane.getPreferredSize(); // 1. the glassPane fills entire viewable region (bounds - insets). // 2. the layeredPane filles entire viewable region. // 3. the menuBar is positioned at the upper edge of layeredPane. // 4. the contentPane fills viewable region minus menuBar, if present. /* if size of top-level window wasn't set then just set contentPane and menuBar to its preferred sizes. Otherwise, if the size of top-level window was specified then set menuBar to its preferred size and make content pane to fit into the remaining space +-------------------------------+ | JLayeredPane | | +--------------------------+ | | | menuBar | | | +--------------------------+ | | +--------------------------+ | | |contentPane | | | | | | | | | | | | | | | +--------------------------+ | +-------------------------------+ */ if (containerWidth == 0 && containerHeight == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); menuBar.setBounds(0, 0, maxWidth, menuBarSize.height); glassPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); contentPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); layeredPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); } else { glassPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); contentPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); layeredPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); } } else { if (menuBar != null) { menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.height > containerHeight) menuBarSize.height = containerHeight; menuBar.setBounds(0, 0, containerWidth, menuBarSize.height); glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, menuBarSize.height, containerWidth, (containerHeight - menuBarSize.height)); } else { glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, 0, containerWidth, containerHeight); } layeredPane.setBounds(0, 0, containerWidth, containerHeight); } } |
|
int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); menuBar.setBounds(0, 0, maxWidth, menuBarSize.height); glassPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); contentPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); layeredPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); | Dimension menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.height > containerHeight) menuBarSize.height = containerHeight; menuBarBounds = new Rectangle(0, 0, containerWidth, menuBarSize.height); contentPaneBounds = new Rectangle(0, menuBarSize.height, containerWidth, containerHeight - menuBarSize.height); | public void layoutContainer(Container c) { Dimension menuBarSize; int containerWidth = c.getBounds().width - getInsets().left - getInsets().right; int containerHeight = c.getBounds().height - getInsets().top - getInsets().bottom; Dimension contentPaneSize = contentPane.getPreferredSize(); // 1. the glassPane fills entire viewable region (bounds - insets). // 2. the layeredPane filles entire viewable region. // 3. the menuBar is positioned at the upper edge of layeredPane. // 4. the contentPane fills viewable region minus menuBar, if present. /* if size of top-level window wasn't set then just set contentPane and menuBar to its preferred sizes. Otherwise, if the size of top-level window was specified then set menuBar to its preferred size and make content pane to fit into the remaining space +-------------------------------+ | JLayeredPane | | +--------------------------+ | | | menuBar | | | +--------------------------+ | | +--------------------------+ | | |contentPane | | | | | | | | | | | | | | | +--------------------------+ | +-------------------------------+ */ if (containerWidth == 0 && containerHeight == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); menuBar.setBounds(0, 0, maxWidth, menuBarSize.height); glassPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); contentPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); layeredPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); } else { glassPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); contentPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); layeredPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); } } else { if (menuBar != null) { menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.height > containerHeight) menuBarSize.height = containerHeight; menuBar.setBounds(0, 0, containerWidth, menuBarSize.height); glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, menuBarSize.height, containerWidth, (containerHeight - menuBarSize.height)); } else { glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, 0, containerWidth, containerHeight); } layeredPane.setBounds(0, 0, containerWidth, containerHeight); } } |
{ glassPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); contentPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); layeredPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); } | contentPaneBounds = new Rectangle(0, 0, containerWidth, containerHeight); glassPaneBounds = new Rectangle(i.left, i.top, containerWidth, containerHeight); layeredPaneBounds = new Rectangle(i.left, i.top, containerWidth, containerHeight); | public void layoutContainer(Container c) { Dimension menuBarSize; int containerWidth = c.getBounds().width - getInsets().left - getInsets().right; int containerHeight = c.getBounds().height - getInsets().top - getInsets().bottom; Dimension contentPaneSize = contentPane.getPreferredSize(); // 1. the glassPane fills entire viewable region (bounds - insets). // 2. the layeredPane filles entire viewable region. // 3. the menuBar is positioned at the upper edge of layeredPane. // 4. the contentPane fills viewable region minus menuBar, if present. /* if size of top-level window wasn't set then just set contentPane and menuBar to its preferred sizes. Otherwise, if the size of top-level window was specified then set menuBar to its preferred size and make content pane to fit into the remaining space +-------------------------------+ | JLayeredPane | | +--------------------------+ | | | menuBar | | | +--------------------------+ | | +--------------------------+ | | |contentPane | | | | | | | | | | | | | | | +--------------------------+ | +-------------------------------+ */ if (containerWidth == 0 && containerHeight == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); menuBar.setBounds(0, 0, maxWidth, menuBarSize.height); glassPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); contentPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); layeredPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); } else { glassPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); contentPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); layeredPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); } } else { if (menuBar != null) { menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.height > containerHeight) menuBarSize.height = containerHeight; menuBar.setBounds(0, 0, containerWidth, menuBarSize.height); glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, menuBarSize.height, containerWidth, (containerHeight - menuBarSize.height)); } else { glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, 0, containerWidth, containerHeight); } layeredPane.setBounds(0, 0, containerWidth, containerHeight); } } |
else { if (menuBar != null) { menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.height > containerHeight) menuBarSize.height = containerHeight; menuBar.setBounds(0, 0, containerWidth, menuBarSize.height); glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, menuBarSize.height, containerWidth, (containerHeight - menuBarSize.height)); } else { glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, 0, containerWidth, containerHeight); } layeredPane.setBounds(0, 0, containerWidth, containerHeight); } | glassPane.setBounds(glassPaneBounds); layeredPane.setBounds(layeredPaneBounds); if (menuBar != null) menuBar.setBounds(menuBarBounds); contentPane.setBounds(contentPaneBounds); | public void layoutContainer(Container c) { Dimension menuBarSize; int containerWidth = c.getBounds().width - getInsets().left - getInsets().right; int containerHeight = c.getBounds().height - getInsets().top - getInsets().bottom; Dimension contentPaneSize = contentPane.getPreferredSize(); // 1. the glassPane fills entire viewable region (bounds - insets). // 2. the layeredPane filles entire viewable region. // 3. the menuBar is positioned at the upper edge of layeredPane. // 4. the contentPane fills viewable region minus menuBar, if present. /* if size of top-level window wasn't set then just set contentPane and menuBar to its preferred sizes. Otherwise, if the size of top-level window was specified then set menuBar to its preferred size and make content pane to fit into the remaining space +-------------------------------+ | JLayeredPane | | +--------------------------+ | | | menuBar | | | +--------------------------+ | | +--------------------------+ | | |contentPane | | | | | | | | | | | | | | | +--------------------------+ | +-------------------------------+ */ if (containerWidth == 0 && containerHeight == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); menuBar.setBounds(0, 0, maxWidth, menuBarSize.height); glassPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); contentPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); layeredPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); } else { glassPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); contentPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); layeredPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); } } else { if (menuBar != null) { menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.height > containerHeight) menuBarSize.height = containerHeight; menuBar.setBounds(0, 0, containerWidth, menuBarSize.height); glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, menuBarSize.height, containerWidth, (containerHeight - menuBarSize.height)); } else { glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, 0, containerWidth, containerHeight); } layeredPane.setBounds(0, 0, containerWidth, containerHeight); } } |
Dimension menuBarSize; Dimension prefSize; Dimension containerSize = c.getSize(); Dimension contentPaneSize = contentPane.getPreferredSize(); if (containerSize.width == 0 && containerSize.height == 0) | synchronized (this) | public Dimension preferredLayoutSize(Container c) { Dimension menuBarSize; Dimension prefSize; Dimension containerSize = c.getSize(); Dimension contentPaneSize = contentPane.getPreferredSize(); if (containerSize.width == 0 && containerSize.height == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); prefSize = new Dimension(maxWidth, contentPaneSize.height + menuBarSize.height); } else prefSize = contentPaneSize; } else prefSize = c.getSize(); return prefSize; } |
int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); prefSize = new Dimension(maxWidth, contentPaneSize.height + menuBarSize.height); | Dimension menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.width > contentPrefSize.width) prefSize.width += menuBarSize.width - contentPrefSize.width; prefSize.height += menuBarSize.height; | public Dimension preferredLayoutSize(Container c) { Dimension menuBarSize; Dimension prefSize; Dimension containerSize = c.getSize(); Dimension contentPaneSize = contentPane.getPreferredSize(); if (containerSize.width == 0 && containerSize.height == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); prefSize = new Dimension(maxWidth, contentPaneSize.height + menuBarSize.height); } else prefSize = contentPaneSize; } else prefSize = c.getSize(); return prefSize; } |
else prefSize = contentPaneSize; | public Dimension preferredLayoutSize(Container c) { Dimension menuBarSize; Dimension prefSize; Dimension containerSize = c.getSize(); Dimension contentPaneSize = contentPane.getPreferredSize(); if (containerSize.width == 0 && containerSize.height == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); prefSize = new Dimension(maxWidth, contentPaneSize.height + menuBarSize.height); } else prefSize = contentPaneSize; } else prefSize = c.getSize(); return prefSize; } |
|
else prefSize = c.getSize(); return prefSize; | return new Dimension(prefSize); } | public Dimension preferredLayoutSize(Container c) { Dimension menuBarSize; Dimension prefSize; Dimension containerSize = c.getSize(); Dimension contentPaneSize = contentPane.getPreferredSize(); if (containerSize.width == 0 && containerSize.height == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); prefSize = new Dimension(maxWidth, contentPaneSize.height + menuBarSize.height); } else prefSize = contentPaneSize; } else prefSize = c.getSize(); return prefSize; } |
Runtime getRunTimeCodeBase(); | RunTime getRunTimeCodeBase(); | Runtime getRunTimeCodeBase(); |
String repositoryID, Runtime sender); | String repositoryID, RunTime sender); | Serializable readValue(InputStream in, int offset, Class clz, String repositoryID, Runtime sender); |
firePropertyChange(CELL_RENDERER_PROPERTY_CHANGED, old, renderer); | firePropertyChange("cellRenderer", old, renderer); | public void setCellRenderer(ListCellRenderer renderer) { if (cellRenderer == renderer) return; ListCellRenderer old = cellRenderer; cellRenderer = renderer; firePropertyChange(CELL_RENDERER_PROPERTY_CHANGED, old, renderer); revalidate(); repaint(); } |
firePropertyChange(FIXED_CELL_WIDTH_PROPERTY_CHANGED, old, h); | firePropertyChange("fixedCellWidth", old, h); | public void setFixedCellHeight(int h) { int old = fixedCellHeight; fixedCellHeight = h; firePropertyChange(FIXED_CELL_WIDTH_PROPERTY_CHANGED, old, h); } |
public void setFixedCellWidth(int h) | public void setFixedCellWidth(int w) | public void setFixedCellWidth(int h) { int old = fixedCellHeight; fixedCellHeight = h; firePropertyChange(FIXED_CELL_HEIGHT_PROPERTY_CHANGED, old, h); } |
int old = fixedCellHeight; fixedCellHeight = h; firePropertyChange(FIXED_CELL_HEIGHT_PROPERTY_CHANGED, old, h); | if (fixedCellWidth == w) return; int old = fixedCellWidth; fixedCellWidth = w; firePropertyChange("fixedCellWidth", old, w); | public void setFixedCellWidth(int h) { int old = fixedCellHeight; fixedCellHeight = h; firePropertyChange(FIXED_CELL_HEIGHT_PROPERTY_CHANGED, old, h); } |
firePropertyChange(MODEL_PROPERTY_CHANGED, old, model); | firePropertyChange("model", old, model); | public void setModel(ListModel model) { if (this.model == model) return; if (this.model != null) this.model.removeListDataListener(listListener); ListModel old = this.model; this.model = model; if (this.model != null) this.model.addListDataListener(listListener); firePropertyChange(MODEL_PROPERTY_CHANGED, old, model); revalidate(); repaint(); } |
firePropertyChange(PROTOTYPE_CELL_VALUE_PROPERTY_CHANGED, old, obj); | firePropertyChange("prototypeCellValue", old, obj); | public void setPrototypeCellValue(Object obj) { Object old = prototypeCellValue; Component comp = getCellRenderer() .getListCellRendererComponent(this, obj, 0, false, false); Dimension d = comp.getPreferredSize(); fixedCellWidth = d.width; fixedCellHeight = d.height; prototypeCellValue = obj; firePropertyChange(PROTOTYPE_CELL_VALUE_PROPERTY_CHANGED, old, obj); } |
firePropertyChange(SELECTION_BACKGROUND_PROPERTY_CHANGED, old, c); | firePropertyChange("selectionBackground", old, c); | public void setSelectionBackground(Color c) { Color old = selectionBackground; selectionBackground = c; firePropertyChange(SELECTION_BACKGROUND_PROPERTY_CHANGED, old, c); repaint(); } |
firePropertyChange(SELECTION_FOREGROUND_PROPERTY_CHANGED, old, c); | firePropertyChange("selectionForeground", old, c); | public void setSelectionForeground(Color c) { Color old = selectionForeground; selectionForeground = c; firePropertyChange(SELECTION_FOREGROUND_PROPERTY_CHANGED, old, c); } |
firePropertyChange(SELECTION_MODEL_PROPERTY_CHANGED, old, model); | firePropertyChange("selectionModel", old, model); | public void setSelectionModel(ListSelectionModel model) { if (selectionModel == model) return; if (selectionModel != null) selectionModel.removeListSelectionListener(listListener); ListSelectionModel old = selectionModel; selectionModel = model; if (selectionModel != null) selectionModel.addListSelectionListener(listListener); firePropertyChange(SELECTION_MODEL_PROPERTY_CHANGED, old, model); revalidate(); repaint(); } |
public PhiAssignQuad(IRBasicBlock dfb, int lhsIndex) { this(dfb.getStartPC(), dfb, lhsIndex); | public PhiAssignQuad(int address, IRBasicBlock block, int lhsIndex) { super(address, block, lhsIndex); phi = new PhiOperand(); | public PhiAssignQuad(IRBasicBlock dfb, int lhsIndex) { this(dfb.getStartPC(), dfb, lhsIndex); } |
System.out.println("session found and closing down " + index); | log.info("session found and closing down " + index); | public void removeSessionView(Session targetSession) { if (hideTabBar && sessionPane.getTabCount() == 0) { for (int x=0; x < getContentPane().getComponentCount(); x++) { if (getContentPane().getComponent(x) instanceof Session) { getContentPane().remove(x); } } } else { int index = sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); int tabs = sessionPane.getTabCount(); sessionPane.remove(index); tabs--; if (index < tabs) { sessionPane.setSelectedIndex(index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(index,focused); ((Session)sessionPane.getComponentAt(index)).requestFocus(); } else { if (tabs > 0) { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(0,focused); ((Session)sessionPane.getComponentAt(0)).requestFocus(); } } } } |
item.processMouseEvent(e, path, manager); | public void processMouseEvent(JMenuItem item, MouseEvent e, MenuElement[] path, MenuSelectionManager manager) { // TODO: What should be done here? } |
|
bad.minor = Minor.Any; | public static NameValuePair[] extract(Any any) { try { return ((NameValuePairSeqHolder) any.extract_Streamable()).value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("NameValuePairSeq expected"); bad.initCause(cex); throw bad; } } |
|
desktopFrame.dispose(); desktopFrame = null; | if(desktopFrame != null) { desktopFrame.dispose(); desktopFrame = null; } | protected void onClose() { log.debug("onClose"); // Stop the repaint manager if (repaintManager != null) { repaintManager.shutdown(); repaintManager = null; } // Close the desktop desktopFrame.dispose(); desktopFrame = null; } |
public void addImpl(Component comp, Object constraints, int index) | protected void addImpl(Component comp, Object constraints, int index) | public void addImpl(Component comp, Object constraints, int index) { if (getComponentCount() > 0) remove(getComponents()[0]); super.addImpl(comp, constraints, index); } |
assert(mark <= gapStart || mark > gapEnd); | assert mark <= gapStart || mark > gapEnd : "mark: " + mark + ", gapStart: " + gapStart + ", gapEnd: " + gapEnd; | public int getOffset() { // Check precondition. assert(mark <= gapStart || mark > gapEnd); if (mark <= gapStart) return mark; else return mark - (gapEnd - gapStart); } |
gapEnd += rmSize; | shiftGapEndUp(gapEnd + rmSize); | protected void replace(int position, int rmSize, Object addItems, int addSize) { // Remove content shiftGap(position); gapEnd += rmSize; // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) < addSize) shiftEnd(addSize); // Add new items to the buffer. if (addItems != null) { System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize; } } |
if ((gapEnd - gapStart) < addSize) shiftEnd(addSize); | if ((gapEnd - gapStart) <= addSize) shiftEnd((addSize - gapEnd + gapStart + 1) * 2 + gapEnd + DEFAULT_BUFSIZE); | protected void replace(int position, int rmSize, Object addItems, int addSize) { // Remove content shiftGap(position); gapEnd += rmSize; // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) < addSize) shiftEnd(addSize); // Add new items to the buffer. if (addItems != null) { System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize; } } |
System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize; | System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize; } | protected void replace(int position, int rmSize, Object addItems, int addSize) { // Remove content shiftGap(position); gapEnd += rmSize; // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) < addSize) shiftEnd(addSize); // Add new items to the buffer. if (addItems != null) { System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize; } } |
} | protected void replace(int position, int rmSize, Object addItems, int addSize) { // Remove content shiftGap(position); gapEnd += rmSize; // If gap is too small, enlarge the gap. if ((gapEnd - gapStart) < addSize) shiftEnd(addSize); // Add new items to the buffer. if (addItems != null) { System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize; } } |
|
int delta = (gapEnd - gapStart) - newSize; | assert newSize > (gapEnd - gapStart) : "The new gap size must be greater " + "than the old gap size"; int delta = newSize - gapEnd + gapStart; Vector v = getPositionsInRange(null, gapEnd, buffer.length - gapEnd); for (Iterator i = v.iterator(); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); p.mark += delta; } | protected void shiftEnd(int newSize) { int delta = (gapEnd - gapStart) - newSize; char[] newBuf = (char[]) allocateArray(length() + newSize); System.arraycopy(buffer, 0, newBuf, 0, gapStart); System.arraycopy(buffer, gapEnd, newBuf, gapStart + newSize, buffer.length - gapEnd); gapEnd = gapStart + newSize; buffer = newBuf; // Update the marks after the gapEnd. int index = Collections.binarySearch(positions, new GapContentPosition( gapEnd)); if (index < 0) { index = -(index + 1); } for (ListIterator i = positions.listIterator(index); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); p.mark += delta; } } |
int index = Collections.binarySearch(positions, new GapContentPosition( gapEnd)); if (index < 0) { index = -(index + 1); } for (ListIterator i = positions.listIterator(index); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); p.mark += delta; } | protected void shiftEnd(int newSize) { int delta = (gapEnd - gapStart) - newSize; char[] newBuf = (char[]) allocateArray(length() + newSize); System.arraycopy(buffer, 0, newBuf, 0, gapStart); System.arraycopy(buffer, gapEnd, newBuf, gapStart + newSize, buffer.length - gapEnd); gapEnd = gapStart + newSize; buffer = newBuf; // Update the marks after the gapEnd. int index = Collections.binarySearch(positions, new GapContentPosition( gapEnd)); if (index < 0) { index = -(index + 1); } for (ListIterator i = positions.listIterator(index); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); p.mark += delta; } } |
|
int newGapEnd = newGapStart + (gapEnd - gapStart); int index1 = Collections.binarySearch(positions, new GapContentPosition(gapEnd)); int index2 = Collections.binarySearch(positions, new GapContentPosition(newGapEnd)); if (index1 > 0 && index2 > 0) { int i1 = Math.min(index1, index2); int i2 = Math.max(index1, index2); for (ListIterator i = positions.listIterator(i1); i.hasNext();) { if (i.nextIndex() > i2) break; GapContentPosition p = (GapContentPosition) i.next(); p.mark += gapEnd - newGapEnd; } } | int newGapEnd = newGapStart + gapEnd - gapStart; | protected void shiftGap(int newGapStart) { if (newGapStart == gapStart) return; int newGapEnd = newGapStart + (gapEnd - gapStart); // Update the positions between newGapEnd and (old) gapEnd. The marks // must be shifted by (gapEnd - newGapEnd). int index1 = Collections.binarySearch(positions, new GapContentPosition(gapEnd)); int index2 = Collections.binarySearch(positions, new GapContentPosition(newGapEnd)); if (index1 > 0 && index2 > 0) { int i1 = Math.min(index1, index2); int i2 = Math.max(index1, index2); for (ListIterator i = positions.listIterator(i1); i.hasNext();) { if (i.nextIndex() > i2) break; GapContentPosition p = (GapContentPosition) i.next(); p.mark += gapEnd - newGapEnd; } } if (newGapStart < gapStart) { System.arraycopy(buffer, newGapStart, buffer, newGapEnd, gapStart - newGapStart); gapStart = newGapStart; gapEnd = newGapEnd; } else { System.arraycopy(buffer, gapEnd, buffer, gapStart, newGapStart - gapStart); gapStart = newGapStart; gapEnd = newGapEnd; } } |
jComponent.getContentPane().setLayout(null); | jComponent.getContentPane().setLayout(new SwingContainerLayout(this)); | public SwingDialogPeer(SwingToolkit toolkit, Dialog dialog) { super(toolkit, dialog, new SwingDialog(dialog)); jComponent.setTitle(dialog.getTitle()); jComponent.getContentPane().setLayout(null); } |
{ | public AccessibleContext getAccessibleContext(){ /* Create the context if this is the first request */ if (accessibleContext == null) { /* Create the context */ accessibleContext = new AccessibleAWTLabel(); } return accessibleContext;} |
|
} | public AccessibleContext getAccessibleContext(){ /* Create the context if this is the first request */ if (accessibleContext == null) { /* Create the context */ accessibleContext = new AccessibleAWTLabel(); } return accessibleContext;} |
|
if (File.separator.equals("/")) | public static FileSystemView getFileSystemView() { if (defaultFileSystemView == null) { if (File.separator.equals("/")) defaultFileSystemView = new UnixFileSystemView(); // FIXME: need to implement additional views // else if (File.Separator.equals("\")) // return new Win32FileSystemView(); // else // return new GenericFileSystemView(); } return defaultFileSystemView; } |
|
return null; | String name = null; if (f != null) name = f.getName(); return name; | public String getSystemDisplayName(File f) { return null; } |
protected void fireConfigChanged() { | protected void fireConfigChanged(SessionConfigEvent sce) { | protected void fireConfigChanged() { if (listeners != null) { int size = listeners.size(); for (int i = 0; i < size; i++) { SessionConfigListener target = (SessionConfigListener)listeners.elementAt(i); target.onConfigChanged(sce); } } } |
public List getAxisTags() { List tags = new ArrayList(); | public String[] getAxisTags() { List axisList = getParentArray().getAxisList(); int stop = axisList.size(); String[] tags = new String[stop]; | public List getAxisTags() { List tags = new ArrayList(); String tag; String axisId; String tempTag; List axisList = getParentArray().getAxisList(); int counter = axisList.size(); for (int i = 0; i<axisList.size(); i++) { axisId = ((Axis)axisList.get(i)).getAxisId(); tag = "d" + counter--; //the default tag //should it exist, we use whats in the tag hash //otherwise we go with the default as singed above tempTag = (String) tagHash.get(axisId); if (tempTag!=null) tag = tempTag; tags.add(tag); } return tags; } |
List axisList = getParentArray().getAxisList(); int counter = axisList.size(); for (int i = 0; i<axisList.size(); i++) { | int counter = stop; for (int i = 0; i < stop; i++) { | public List getAxisTags() { List tags = new ArrayList(); String tag; String axisId; String tempTag; List axisList = getParentArray().getAxisList(); int counter = axisList.size(); for (int i = 0; i<axisList.size(); i++) { axisId = ((Axis)axisList.get(i)).getAxisId(); tag = "d" + counter--; //the default tag //should it exist, we use whats in the tag hash //otherwise we go with the default as singed above tempTag = (String) tagHash.get(axisId); if (tempTag!=null) tag = tempTag; tags.add(tag); } return tags; } |
tag = "d" + counter--; | counter--; tag = "d" + counter; | public List getAxisTags() { List tags = new ArrayList(); String tag; String axisId; String tempTag; List axisList = getParentArray().getAxisList(); int counter = axisList.size(); for (int i = 0; i<axisList.size(); i++) { axisId = ((Axis)axisList.get(i)).getAxisId(); tag = "d" + counter--; //the default tag //should it exist, we use whats in the tag hash //otherwise we go with the default as singed above tempTag = (String) tagHash.get(axisId); if (tempTag!=null) tag = tempTag; tags.add(tag); } return tags; } |
tags.add(tag); | tags[i] = tag; | public List getAxisTags() { List tags = new ArrayList(); String tag; String axisId; String tempTag; List axisList = getParentArray().getAxisList(); int counter = axisList.size(); for (int i = 0; i<axisList.size(); i++) { axisId = ((Axis)axisList.get(i)).getAxisId(); tag = "d" + counter--; //the default tag //should it exist, we use whats in the tag hash //otherwise we go with the default as singed above tempTag = (String) tagHash.get(axisId); if (tempTag!=null) tag = tempTag; tags.add(tag); } return tags; } |
for (int i = 0; i < attribs.size(); i++) { | int stop = attribs.size(); for (int i = 0; i < stop; i++) { | public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = super.sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + super.sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<"+classXDFNodeName); //get attribute info Hashtable xmlInfo = getXMLInfo(); //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); //write out the tags info List tags = Collections.synchronizedList(getAxisTags()); List axisList = parentArray.getAxisList(); String axisId; String tag; for (int i = 0; i <axisList.size(); i++) { axisId = ((Axis) axisList.get(i)).getAxisId(); tag = (String)tags.get(i); if (niceOutput) { writeOut(outputstream, moreIndent); } writeOut(outputstream, "<" + TagToAxisNodeName + " axisIdRef=\\" + axisId + "\\" + "tag = \\" + tag + "\\/>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } //close the read block if (niceOutput) { writeOut(outputstream,indent); } writeOut(outputstream, "</"+classXDFNodeName+">"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } |
List tags = Collections.synchronizedList(getAxisTags()); | String[] tags = getAxisTags(); | public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = super.sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + super.sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<"+classXDFNodeName); //get attribute info Hashtable xmlInfo = getXMLInfo(); //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); //write out the tags info List tags = Collections.synchronizedList(getAxisTags()); List axisList = parentArray.getAxisList(); String axisId; String tag; for (int i = 0; i <axisList.size(); i++) { axisId = ((Axis) axisList.get(i)).getAxisId(); tag = (String)tags.get(i); if (niceOutput) { writeOut(outputstream, moreIndent); } writeOut(outputstream, "<" + TagToAxisNodeName + " axisIdRef=\\" + axisId + "\\" + "tag = \\" + tag + "\\/>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } //close the read block if (niceOutput) { writeOut(outputstream,indent); } writeOut(outputstream, "</"+classXDFNodeName+">"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } |
for (int i = 0; i <axisList.size(); i++) { axisId = ((Axis) axisList.get(i)).getAxisId(); tag = (String)tags.get(i); if (niceOutput) { writeOut(outputstream, moreIndent); } writeOut(outputstream, "<" + TagToAxisNodeName + " axisIdRef=\\" + axisId + "\\" + "tag = \\" + tag + "\\/>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } | int stop = axisList.size(); synchronized (axisList) { for (int i = 0; i <stop; i++) { axisId = ((Axis) axisList.get(i)).getAxisId(); tag = tags[i]; if (niceOutput) { writeOut(outputstream, moreIndent); } writeOut(outputstream, "<" + TagToAxisNodeName + " axisIdRef=\"" + axisId + "\"" + " tag = \"" + tag + "\"/>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } | public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent ) { boolean niceOutput = super.sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + super.sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<"+classXDFNodeName); //get attribute info Hashtable xmlInfo = getXMLInfo(); //write out attributes ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { //sync, prevent the attribs' structure be changed for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } writeOut(outputstream, ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); //write out the tags info List tags = Collections.synchronizedList(getAxisTags()); List axisList = parentArray.getAxisList(); String axisId; String tag; for (int i = 0; i <axisList.size(); i++) { axisId = ((Axis) axisList.get(i)).getAxisId(); tag = (String)tags.get(i); if (niceOutput) { writeOut(outputstream, moreIndent); } writeOut(outputstream, "<" + TagToAxisNodeName + " axisIdRef=\\" + axisId + "\\" + "tag = \\" + tag + "\\/>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } //close the read block if (niceOutput) { writeOut(outputstream,indent); } writeOut(outputstream, "</"+classXDFNodeName+">"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } |
int cp = screen52.getCurrentPos(); | int cp = screen52.getScreenFields().getCurrentFieldPos(); | public final void saveScreen() throws IOException { ByteArrayOutputStream sc = new ByteArrayOutputStream(); sc.write(4); sc.write(0x12); // 18 sc.write(0); // 18 sc.write(0); // 18 sc.write((byte) screen52.getRows()); // store the current size sc.write((byte) screen52.getColumns()); // "" int cp = screen52.getCurrentPos(); // save off current position sc.write((byte) (cp >> 8 & 0xff)); // "" sc.write((byte) (cp & 0xff)); // "" sc.write((byte) (screen52.homePos >> 8 & 0xff)); // save home pos sc.write((byte) (screen52.homePos & 0xff)); // "" int rows = screen52.getRows(); // store the current size int cols = screen52.getColumns(); // ""// byte[] sa = new byte[rows * cols]; fillRegenerationBuffer(sc,rows,cols);// fillScreenArray(sa, rows, cols);//// sc.write(sa);// sa = null; int sizeFields = screen52.getScreenFields().getSize(); sc.write((byte) (sizeFields >> 8 & 0xff)); // "" sc.write((byte) (sizeFields & 0xff)); // "" if (sizeFields > 0) { int x = 0; int s = screen52.getScreenFields().getSize(); ScreenField sf = null; while (x < s) { sf = screen52.getScreenFields().getField(x); sc.write((byte) sf.getAttr()); // attribute int sp = sf.startPos(); sc.write((byte) (sp >> 8 & 0xff)); // "" sc.write((byte) (sp & 0xff)); // "" if (sf.mdt) sc.write((byte) 1); else sc.write((byte) 0); sc.write((byte) (sf.getLength() >> 8 & 0xff)); // "" sc.write((byte) (sf.getLength() & 0xff)); // "" sc.write((byte) sf.getFFW1() & 0xff); sc.write((byte) sf.getFFW2() & 0xff); sc.write((byte) sf.getFCW1() & 0xff); sc.write((byte) sf.getFCW2() & 0xff); log.debug("Saved "); log.debug(sf.toString()); x++; } sf = null; } // The following two lines of code looks to have caused all sorts of // problems so for now we have commented them out. // screen52.getScreenFields().setCurrentField(null); // set it to null // for GC ? // screen52.clearTable(); try { writeGDS(0, 3, sc.toByteArray()); } catch (IOException ioe) { log.warn(ioe.getMessage()); } sc = null; log.debug("Save Screen end "); } |
if (pendingUnlock) | if (pendingUnlock && !screen52.isStatusErrorCode()) { | public void run () { while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); invited = false; screen52.setCursorOff();// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!signedOn) { signedOn = true;// signOnSave = new char[screen52.getScreenLength()]; signOnSave = screen52.getScreenAsChars(); System.out.println("Signon saved"); } break; case 4:// System.out.println("Save Screen Operation"); parseIncoming(); break; case 5:// System.out.println("Restore Screen Operation"); parseIncoming(); break; case 6:// System.out.println("Read Immediate"); sendAidKey(0); break; case 7:// System.out.println("Reserved"); break; case 8:// System.out.println("Read Screen Operation"); try { readScreen(); } catch (IOException ex) { } break; case 9:// System.out.println("Reserved"); break; case 10:// System.out.println("Cancel Invite Operation"); cancelInvite(); break; case 11:// System.out.println("Turn on message light"); screen52.setMessageLightOn(); screen52.setCursorOn(); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorOn(); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock) screen52.setKeyboardLocked(false); if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorOn(); cursorOn = false; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); } } |
} | public void run () { while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); invited = false; screen52.setCursorOff();// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!signedOn) { signedOn = true;// signOnSave = new char[screen52.getScreenLength()]; signOnSave = screen52.getScreenAsChars(); System.out.println("Signon saved"); } break; case 4:// System.out.println("Save Screen Operation"); parseIncoming(); break; case 5:// System.out.println("Restore Screen Operation"); parseIncoming(); break; case 6:// System.out.println("Read Immediate"); sendAidKey(0); break; case 7:// System.out.println("Reserved"); break; case 8:// System.out.println("Read Screen Operation"); try { readScreen(); } catch (IOException ex) { } break; case 9:// System.out.println("Reserved"); break; case 10:// System.out.println("Cancel Invite Operation"); cancelInvite(); break; case 11:// System.out.println("Turn on message light"); screen52.setMessageLightOn(); screen52.setCursorOn(); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorOn(); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock) screen52.setKeyboardLocked(false); if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorOn(); cursorOn = false; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); } } |
|
screen52.setPrehelpState(true); | public void sendNegResponse2(int ec) { baosp.write(0x00); baosp.write(ec); try { writeGDS(1, 0, baosp.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } baosp.reset(); } |
|
screen52.setStatus(screen52.STATUS_ERROR_CODE,screen52.STATUS_VALUE_ON,null); | private final void writeErrorCode() throws Exception { screen52.goto_XY(screen52.getErrorLine(),1); // Skip the control byte screen52.saveErrorLine(); screen52.setStatus(screen52.STATUS_ERROR_CODE,screen52.STATUS_VALUE_ON,null); cursorOn = true; } |
|
screen52.setStatus(screen52.STATUS_ERROR_CODE,screen52.STATUS_VALUE_ON,null); | private final void writeErrorCodeToWindow() throws Exception { int fromCol = bk.getNextByte() & 0xff; // from column int toCol = bk.getNextByte() & 0xff; // to column screen52.goto_XY(screen52.getErrorLine(),fromCol); // Skip the control byte screen52.saveErrorLine(); screen52.setStatus(screen52.STATUS_ERROR_CODE,screen52.STATUS_VALUE_ON,null); cursorOn = true; } |
|
public UnresolvedObjectRefException(String s) { super(s); | public UnresolvedObjectRefException() { super(); | public UnresolvedObjectRefException(String s) { super(s); } |
res.put("java.vm.version", "0.1.5"); | res.put("java.vm.version", vm.getVersion()); | public static Properties getInitProperties() { final String arch; arch = Unsafe.getCurrentProcessor().getArchitecture().getName(); Unsafe.debug("arch="); Unsafe.debug(arch); final Properties res = new Properties(); res.put("java.version", "1.1.0"); res.put("java.vendor", "JNode.org"); res.put("java.vendor.url", "http://jnode.org"); res.put("java.home", "/"); res.put("java.vm.specification.version", "1.4"); res.put("java.vm.specification.vendor", "JNode.org"); res.put("java.vm.specification.name", "jnode"); res.put("java.vm.version", "0.1.5"); res.put("java.vm.vendor", "JNode.org"); res.put("java.vm.name", "JNode"); res.put("java.class.version", "1.1"); res.put("java.class.path", ""); res.put("java.library.path", ""); res.put("java.io.tmpdir", "/tmp"); res.put("java.compiler", "Internal"); res.put("java.ext.dirs", ""); res.put("os.name", "JNode"); res.put("os.arch", arch); res.put("os.version", "0.1.5"); res.put("file.separator", "/"); res.put("path.separator", ":"); res.put("line.separator", "\n"); res.put("user.name", "System"); res.put("user.home", "/"); res.put("user.dir", "/"); return res; } |
res.put("os.version", "0.1.5"); | res.put("os.version", vm.getVersion()); | public static Properties getInitProperties() { final String arch; arch = Unsafe.getCurrentProcessor().getArchitecture().getName(); Unsafe.debug("arch="); Unsafe.debug(arch); final Properties res = new Properties(); res.put("java.version", "1.1.0"); res.put("java.vendor", "JNode.org"); res.put("java.vendor.url", "http://jnode.org"); res.put("java.home", "/"); res.put("java.vm.specification.version", "1.4"); res.put("java.vm.specification.vendor", "JNode.org"); res.put("java.vm.specification.name", "jnode"); res.put("java.vm.version", "0.1.5"); res.put("java.vm.vendor", "JNode.org"); res.put("java.vm.name", "JNode"); res.put("java.class.version", "1.1"); res.put("java.class.path", ""); res.put("java.library.path", ""); res.put("java.io.tmpdir", "/tmp"); res.put("java.compiler", "Internal"); res.put("java.ext.dirs", ""); res.put("os.name", "JNode"); res.put("os.arch", arch); res.put("os.version", "0.1.5"); res.put("file.separator", "/"); res.put("path.separator", ":"); res.put("line.separator", "\n"); res.put("user.name", "System"); res.put("user.home", "/"); res.put("user.dir", "/"); return res; } |
if (!initStageDone) super.addImpl(comp, constraints, index); | if (isRootPaneCheckingEnabled()) getContentPane().add(comp, constraints, index); | protected void addImpl(Component comp, Object constraints, int index) { // If we're adding in the initialization stage use super.add. // otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not use add() on JWindow directly. Use " + "getContentPane().add() instead"); getContentPane().add(comp, constraints, index); } } |
{ if (isRootPaneCheckingEnabled()) throw new Error("Do not use add() on JWindow directly. Use " + "getContentPane().add() instead"); getContentPane().add(comp, constraints, index); } | super.addImpl(comp, constraints, index); | protected void addImpl(Component comp, Object constraints, int index) { // If we're adding in the initialization stage use super.add. // otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not use add() on JWindow directly. Use " + "getContentPane().add() instead"); getContentPane().add(comp, constraints, index); } } |
initStageDone = true; | setRootPaneCheckingEnabled(true); | protected void windowInit() { super.setLayout(new BorderLayout(1, 1)); getRootPane(); // will do set/create // Now we're done init stage, adds and layouts go to content pane. initStageDone = true; } |
myFrameList.add(frame); | public void addSessionView(String tabText,Session session) { MyInternalFrame frame = new MyInternalFrame(); frame.setVisible(true); desktop.add(frame); selectedIndex = desktop.getComponentCount(); frame.setContentPane(session); try { frame.setSelected(true); } catch (java.beans.PropertyVetoException e) {} session.addSessionListener(this); session.addSessionJumpListener(this); try { frame.setMaximum(true); } catch (java.beans.PropertyVetoException pve) { System.out.println("Can not set maximum " + pve.getMessage()); } } |
|
myFrameList = new Vector(3); | private void jbInit() throws Exception { desktop = new JDesktopPane(); // Install our custom desktop manager desktop.setDesktopManager(new MyDesktopMgr()); setContentPane(desktop); if (sequence > 0) setTitle("tn5250j <" + sequence + ">- " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); else setTitle("tn5250j - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); if (packFrame) pack(); else validate(); } |
|
for (int x = 0; x < frames.length; x++){ MyInternalFrame mif = (MyInternalFrame)frames[x]; System.out.println(" current index " + x + " count " + frames.length + " has focus " + mif.isActive() + " title " + mif.getTitle()); if (mif.getInternalId() > seq) { index = x; | for (int x = 0; x < myFrameList.size(); x++) { MyInternalFrame mif = (MyInternalFrame)myFrameList.get(x); if (mix.equals(mif)) { index = x + 1; | private void nextSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); MyInternalFrame mix = (MyInternalFrame)frames[index]; int seq = mix.getInternalId(); index = 0; for (int x = 0; x < frames.length; x++){ MyInternalFrame mif = (MyInternalFrame)frames[x]; System.out.println(" current index " + x + " count " + frames.length + " has focus " + mif.isActive() + " title " + mif.getTitle()); if (mif.getInternalId() > seq) { index = x; break; } } System.out.println(" current index " + index + " count " + desktop.getComponentCount()); if (index < desktop.getComponentCount() - 1) { try { frames[index].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } } |
System.out.println(" current index " + index + " count " + desktop.getComponentCount()); if (index < desktop.getComponentCount() - 1) { try { frames[index].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } | if (index > myFrameList.size() - 1) { index = 0; | private void nextSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); MyInternalFrame mix = (MyInternalFrame)frames[index]; int seq = mix.getInternalId(); index = 0; for (int x = 0; x < frames.length; x++){ MyInternalFrame mif = (MyInternalFrame)frames[x]; System.out.println(" current index " + x + " count " + frames.length + " has focus " + mif.isActive() + " title " + mif.getTitle()); if (mif.getInternalId() > seq) { index = x; break; } } System.out.println(" current index " + index + " count " + desktop.getComponentCount()); if (index < desktop.getComponentCount() - 1) { try { frames[index].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } } |
try { ((MyInternalFrame)myFrameList.get(index)).setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } | private void nextSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); MyInternalFrame mix = (MyInternalFrame)frames[index]; int seq = mix.getInternalId(); index = 0; for (int x = 0; x < frames.length; x++){ MyInternalFrame mif = (MyInternalFrame)frames[x]; System.out.println(" current index " + x + " count " + frames.length + " has focus " + mif.isActive() + " title " + mif.getTitle()); if (mif.getInternalId() > seq) { index = x; break; } } System.out.println(" current index " + index + " count " + desktop.getComponentCount()); if (index < desktop.getComponentCount() - 1) { try { frames[index].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } } |
|
JInternalFrame miv = (JInternalFrame)desktop.getSelectedFrame(); int index = selectedIndex; | JInternalFrame miv = desktop.getSelectedFrame(); | private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = (JInternalFrame)desktop.getSelectedFrame();// int index = desktop.getIndexOf(miv); int index = selectedIndex; if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); selectedIndex = frames.length -1; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); selectedIndex--; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } } |
if (index == 0) { try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); selectedIndex = frames.length -1; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); | if (miv == null) return; int index = desktop.getIndexOf(miv); if (index == -1) return; MyInternalFrame mix = (MyInternalFrame)frames[index]; int seq = mix.getInternalId(); index = 0; for (int x = 0; x < myFrameList.size(); x++) { MyInternalFrame mif = (MyInternalFrame)myFrameList.get(x); if (mix.equals(mif)) { index = x - 1; break; | private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = (JInternalFrame)desktop.getSelectedFrame();// int index = desktop.getIndexOf(miv); int index = selectedIndex; if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); selectedIndex = frames.length -1; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); selectedIndex--; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } } |
else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); selectedIndex--; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } | private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = (JInternalFrame)desktop.getSelectedFrame();// int index = desktop.getIndexOf(miv); int index = selectedIndex; if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); selectedIndex = frames.length -1; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); selectedIndex--; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } } |
|
try { ((MyInternalFrame)myFrameList.get(index)).setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } | private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = (JInternalFrame)desktop.getSelectedFrame();// int index = desktop.getIndexOf(miv); int index = selectedIndex; if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); selectedIndex = frames.length -1; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); selectedIndex--; } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } } |
|
desktop.remove(index); | public void removeSessionView(Session targetSession) { int index = getIndexOfSession(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); desktop.remove(index); this.repaint(); } |
|
if (closed) throw new IllegalStateException("ZipFile has closed: " + name); | checkClosed(); | private HashMap getEntries() throws IOException { synchronized(raf) { if (closed) throw new IllegalStateException("ZipFile has closed: " + name); if (entries == null) readEntries(); return entries; } } |
checkClosed(); | public int size() { try { return getEntries().size(); } catch (IOException ioe) { return 0; } } |
|
int lm1 = len - 1; for (int i = off; i < len; i++) | int end = off + len; int em1 = end - 1; for (int i = off; i < end; i++) | private int indexOfCRLF(byte[] b, int off, int len) throws IOException { doReset = false; int lm1 = len - 1; for (int i = off; i < len; i++) { if (b[i] == CR) { int d; if (i == lm1) { d = in.read(); doReset = true; } else { d = b[i + 1]; } if (d == LF) { doReset = true; return i; } } } return -1; } |
if (i == lm1) | if (i == em1) | private int indexOfCRLF(byte[] b, int off, int len) throws IOException { doReset = false; int lm1 = len - 1; for (int i = off; i < len; i++) { if (b[i] == CR) { int d; if (i == lm1) { d = in.read(); doReset = true; } else { d = b[i + 1]; } if (d == LF) { doReset = true; return i; } } } return -1; } |
int oldx = this.x; int oldy = this.y; if (this.x == x && this.y == y) return; invalidate (); this.x = x; this.y = y; if (peer != null) peer.setBounds (x, y, width, height); if (isLightweight() && width != 0 && height !=0) { parent.repaint(oldx, oldy, width, height); repaint(); } if (oldx != x || oldy != y) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } | setBounds(x, y, this.width, this.height); | public void move(int x, int y) { int oldx = this.x; int oldy = this.y; if (this.x == x && this.y == y) return; invalidate (); this.x = x; this.y = y; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight() && width != 0 && height !=0) { parent.repaint(oldx, oldy, width, height); repaint(); } if (oldx != x || oldy != y) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } } |
e.consume(); | protected void processMouseEvent(MouseEvent e) { if (mouseListener == null) return; switch (e.id) { case MouseEvent.MOUSE_CLICKED: mouseListener.mouseClicked(e); break; case MouseEvent.MOUSE_ENTERED: mouseListener.mouseEntered(e); break; case MouseEvent.MOUSE_EXITED: mouseListener.mouseExited(e); break; case MouseEvent.MOUSE_PRESSED: mouseListener.mousePressed(e); break; case MouseEvent.MOUSE_RELEASED: mouseListener.mouseReleased(e); break; } } |
|
e.consume(); } | protected void processMouseWheelEvent(MouseWheelEvent e) { if (mouseWheelListener != null && e.id == MouseEvent.MOUSE_WHEEL) mouseWheelListener.mouseWheelMoved(e); } |
|
int oldwidth = this.width; int oldheight = this.height; if (this.width == width && this.height == height) return; invalidate (); this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); if (isLightweight()) { if (oldwidth != 0 && oldheight != 0 && parent != null) parent.repaint(x, y, oldwidth, oldheight); if (width != 0 && height != 0) repaint(); } if (oldwidth != width || oldheight != height) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } | setBounds(this.x, this.y, width, height); | public void resize(int width, int height) { int oldwidth = this.width; int oldheight = this.height; if (this.width == width && this.height == height) return; invalidate (); this.width = width; this.height = height; if (peer != null) peer.setBounds (x, y, width, height); // Erase old bounds and repaint new bounds for lightweights. if (isLightweight()) { if (oldwidth != 0 && oldheight != 0 && parent != null) parent.repaint(x, y, oldwidth, oldheight); if (width != 0 && height != 0) repaint(); } if (oldwidth != width || oldheight != height) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } } |
me.closeSession((Session)this.getContentPane()); | Session s = (Session)getContentPane(); me.closeSession(s); | private void disconnectMe() { me.closeSession((Session)this.getContentPane()); } |
return desktop.getIndexOf(session) >= 0; | return getIndexOfSession(session) >= 0; | public boolean containsSession(Session session) { return desktop.getIndexOf(session) >= 0; } |
if (frames[idx].getContentPane().equals(session)) { | Session ses = (Session)frames[idx].getContentPane(); if (ses.equals(session)) { | public int getIndexOfSession(Session session) { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); int index = -1; for (int idx = 0; idx < frames.length; idx++) { if (frames[idx].getContentPane().equals(session)) { index = idx; return index; } } return index; } |
setContentPane(desktop); | private void jbInit() throws Exception { desktop = new JDesktopPane(); setContentPane(desktop); // Install our custom desktop manager desktop.setDesktopManager(new MyDesktopMgr()); if (sequence > 0) setTitle("tn5250j <" + sequence + ">- " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); else setTitle("tn5250j - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); if (packFrame) pack(); else validate(); } |
|
setContentPane(desktop); | private void jbInit() throws Exception { desktop = new JDesktopPane(); setContentPane(desktop); // Install our custom desktop manager desktop.setDesktopManager(new MyDesktopMgr()); if (sequence > 0) setTitle("tn5250j <" + sequence + ">- " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); else setTitle("tn5250j - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); if (packFrame) pack(); else validate(); } |
|
{ return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } | return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0 }; | private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; } |
{ return new int[] {0, fields[DAY_OF_YEAR]}; } | return new int[] { 0, fields[DAY_OF_YEAR] }; | private int[] getDayOfYear(int year) { if (isSet[MONTH]) { int dayOfYear; if (fields[MONTH] > FEBRUARY) { // The months after February are regular: // 9 is an offset found by try and error. dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5; if (isLeapYear(year)) dayOfYear++; } else dayOfYear = 31 * fields[MONTH]; if (isSet[DAY_OF_MONTH]) { return new int[] { dayOfYear + fields[DAY_OF_MONTH], 0}; } if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday + // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. 7 * (fields[WEEK_OF_MONTH] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH]) { // the weekday of the first day in that month is: int weekday = getWeekDay(year, ++dayOfYear); return new int[] { dayOfYear, fields[DAY_OF_WEEK] - weekday + 7 * (fields[DAY_OF_WEEK_IN_MONTH] + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))}; } } // MONTH + something did not succeed. if (isSet[DAY_OF_YEAR]) { return new int[] {0, fields[DAY_OF_YEAR]}; } if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR]) { int dayOfYear = getMinimalDaysInFirstWeek(); // the weekday of the day, that begins the first week // in that year is: int weekday = getWeekDay(year, dayOfYear); return new int[] { dayOfYear, // the day of week in the first week // (weeks starting on sunday) is: fields[DAY_OF_WEEK] - weekday // Now jump to the right week and correct the possible // error made by assuming sunday is the first week day. + 7 * (fields[WEEK_OF_YEAR] + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1) + (weekday < getFirstDayOfWeek()? -1 : 0))}; } // As last resort return Jan, 1st. return new int[] {1, 0}; } |
updateLayoutStateNeeded |= modelChanged; | public void contentsChanged(ListDataEvent e) { list.revalidate(); } |
|
updateLayoutStateNeeded |= modelChanged; | public void intervalAdded(ListDataEvent e) { list.revalidate(); } |
|
updateLayoutStateNeeded |= modelChanged; | public void intervalRemoved(ListDataEvent e) { list.revalidate(); } |
|
if (e.getSource() == BasicListUI.this.list) | if (e.getPropertyName().equals("model")) | public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; } |
((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); | { ListModel oldModel = (ListModel) e.getOldValue(); oldModel.removeListDataListener(listDataListener); } if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) { ListModel newModel = (ListModel) e.getNewValue(); newModel.addListDataListener(BasicListUI.this.listDataListener); } | public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; } |
if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); | updateLayoutStateNeeded |= modelChanged; | public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; } |
if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; | public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } // Update the updateLayoutStateNeeded flag. if (e.getPropertyName().equals("model")) updateLayoutStateNeeded |= modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded |= selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded |= fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded |= fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded |= fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded |= prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded |= cellRendererChanged; } |
|
Rectangle bounds = new Rectangle(loc.x, loc.y, cellWidth, | int width = cellWidth; if (l.getLayoutOrientation() == JList.VERTICAL) width = l.getWidth(); Rectangle bounds = new Rectangle(loc.x, loc.y, width, | public Rectangle getCellBounds(JList l, int index1, int index2) { maybeUpdateLayoutState(); if (l != list || cellWidth == -1) return null; int minIndex = Math.min(index1, index2); int maxIndex = Math.max(index1, index2); Point loc = indexToLocation(list, minIndex); Rectangle bounds = new Rectangle(loc.x, loc.y, cellWidth, getCellHeight(minIndex)); for (int i = minIndex + 1; i <= maxIndex; i++) { Point hiLoc = indexToLocation(list, i); Rectangle hibounds = new Rectangle(hiLoc.x, hiLoc.y, cellWidth, getCellHeight(i)); bounds = bounds.union(hibounds); } return bounds; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.