rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); }
g.drawLine(x + 2, y + h - 2, x + w - 1, y + h - 2); break; case SwingConstants.BOTTOM: g.setColor(shadow); g.drawLine(x + w - 2, y, x + w - 2, y + h - 2);
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x ...
if (! isSelected || tabPlacement != SwingConstants.RIGHT) {
g.drawLine(x + 2, y + h - 1, x + w - 3, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w - 1, y, x + w - 1, y + h - 3); g.drawLine(x + w - 1, y + h - 2, x + w - 3, y + h); g.drawLine(x + 2, y + h, x + w - 4, y + h);
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x ...
g.drawLine(x, y, x, y + h); }
g.drawLine(x, y, x, y + h - 3);
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x ...
if (! isSelected || tabPlacement != SwingConstants.BOTTOM) {
g.drawLine(x, y + h - 2, x + 1, y + h - 1); break; case SwingConstants.RIGHT:
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x ...
g.drawLine(x, y, x + w, y);
g.drawLine(x, y, x + w - 3, y); g.setColor(darkShadow); g.drawLine(x + w - 2, y + 1, x + w - 1, y + 2); g.drawLine(x + w - 1, y + 3, x + w - 1, y + h - 3); g.drawLine(x + w - 2, y + h - 2, x + w - 3, y + h - 1); g.drawLine(x, y + h - 1, x + w - 4, y + h - 1); g.setColor(shadow); g.drawLine(x + w - 2, y + 2, ...
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x ...
default:
protected static void rotateInsets(Insets topInsets, Insets targetInsets, int targetPlacement) { // Sun's version will happily throw an NPE if params are null, // so I won't check it either. switch (targetPlacement) { case SwingConstants.TOP: targetInsets.top =...
}
protected void selectAdjacentRunTab(int tabPlacement, int tabIndex, int offset) { int x = rects[tabIndex].x + rects[tabIndex].width / 2; int y = rects[tabIndex].y + rects[tabIndex].height / 2; switch (tabPlacement) { case SwingConstants.TOP: case SwingConstants....
tabPane.setSelectedIndex(getNextTabIndex(current));
current = getNextTabIndex(current); if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) scrollTab(current, tabPane.getTabPlacement()); tabPane.setSelectedIndex(current);
protected void selectNextTab(int current) { tabPane.setSelectedIndex(getNextTabIndex(current)); }
tabPane.setSelectedIndex(getNextTabIndexInRun(tabPane.getTabCount(), current));
current = getNextTabIndexInRun(tabPane.getTabCount(), current); if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) scrollTab(current, tabPane.getTabPlacement()); tabPane.setSelectedIndex(current);
protected void selectNextTabInRun(int current) { tabPane.setSelectedIndex(getNextTabIndexInRun(tabPane.getTabCount(), current)); }
tabPane.setSelectedIndex(getPreviousTabIndex(current));
current = getPreviousTabIndex(current); if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) scrollTab(current, tabPane.getTabPlacement()); tabPane.setSelectedIndex(current);
protected void selectPreviousTab(int current) { tabPane.setSelectedIndex(getPreviousTabIndex(current)); }
tabPane.setSelectedIndex(getPreviousTabIndexInRun(tabPane.getTabCount(), current));
current = getPreviousTabIndexInRun(tabPane.getTabCount(), current); if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) scrollTab(current, tabPane.getTabPlacement()); tabPane.setSelectedIndex(current);
protected void selectPreviousTabInRun(int current) { tabPane.setSelectedIndex(getPreviousTabIndexInRun(tabPane.getTabCount(), current)); }
int index = -1;
int index = tabPane.getSelectedIndex();
public int tabForCoordinate(JTabbedPane pane, int x, int y) { if (! tabPane.isValid()) tabPane.validate(); int tabCount = tabPane.getTabCount(); int index = -1; for (int i = 0; i < tabCount; ++i) { if (rects[i].contains(x, y)) { index = i; break; }...
if (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport);
protected void uninstallComponents() { // Nothing to be done. }
LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font");
selectedColor = null;
protected void uninstallDefaults() { calcRect = null; tabAreaRect = null; contentRect = null; tabRuns = null; contentBorderInsets = null; tabAreaInsets = null; selectedTabPadInsets = null; tabInsets = null; focus = null; darkShadow = null; shadow = null; lightHighlight = null; ...
throws NotImplementedException
protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: Implement. }
SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: Implement. }
if (incrButton != null) incrButton.removeMouseListener(mouseListener); if (decrButton != null) decrButton.removeMouseListener(mouseListener); if (panel != null) { panel.removeMouseListener(mouseListener); panel.removeFocusListener(focusListener); }
protected void uninstallListeners() { tabPane.removeFocusListener(focusListener); tabPane.removePropertyChangeListener(propertyChangeListener); tabPane.removeChangeListener(tabChangeListener); tabPane.removeMouseListener(mouseListener); focusListener = null; propertyChangeListener = null; tabCha...
if (sPrettyXDFOutput) {
if (Specification.getInstance().isPrettyXDFOutput()) {
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NE...
nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop);
nestedToXDF(outputstream, indent + Specification.getInstance().getPrettyXDFOutputIndentation(), which, stop);
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NE...
sel.clear();
setSelectionInterval(index0, index1);
public void addSelectionInterval(int index0, int index1) { int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); oldSel = sel.clone(); if (selectionMode == SINGLE_SELECTION) sel.clear(); // COMPAT: Like Sun (but not like IBM), we allow calls to // addSelectionInterval when se...
if (selectionMode == SINGLE_SELECTION) index0 = index1;
public void addSelectionInterval(int index0, int index1) { int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); oldSel = sel.clone(); if (selectionMode == SINGLE_SELECTION) sel.clear(); // COMPAT: Like Sun (but not like IBM), we allow calls to // addSelectionInterval when se...
if (selectionMode == SINGLE_SELECTION) setSelectionInterval (leadIndex, leadIndex);
public void setLeadSelectionIndex(int leadIndex) { int oldLeadIndex = leadSelectionIndex; if (oldLeadIndex == -1) oldLeadIndex = leadIndex; if (setLeadCalledFromAdd == false) oldSel = sel.clone(); leadSelectionIndex = leadIndex; if (anchorSelectionIndex == -1) return; int R1 = Math.m...
if ((r && isRollover()) || (!r && !isRollover()))
if (r == isRollover())
public void setRollover(boolean r) { // if this call does not represent a CHANGE in state, then return if ((r && isRollover()) || (!r && !isRollover())) return; // cannot set ROLLOVER property unless button is enabled if (!isEnabled()) return; // make the change if (r) stateMask ...
null, ItemEvent.SELECTED));
this, ItemEvent.SELECTED));
public void setSelected(boolean s) { // if this call does not represent a CHANGE in state, then return if ((s && isSelected()) || (!s && !isSelected())) return; // make the change if (s) stateMask = stateMask | SELECTED; else stateMask = stateMask & (~SELECTED); // notify interes...
null, ItemEvent.DESELECTED));
this, ItemEvent.DESELECTED));
public void setSelected(boolean s) { // if this call does not represent a CHANGE in state, then return if ((s && isSelected()) || (!s && !isSelected())) return; // make the change if (s) stateMask = stateMask | SELECTED; else stateMask = stateMask & (~SELECTED); // notify interes...
protected DSSKey(BigInteger p, BigInteger q, BigInteger g)
protected DSSKey(int defaultFormat, BigInteger p, BigInteger q, BigInteger g)
protected DSSKey(BigInteger p, BigInteger q, BigInteger g) { super(); this.p = p; this.q = q; this.g = g; }
this.defaultFormat = defaultFormat <= 0 ? Registry.RAW_ENCODING_ID : defaultFormat;
protected DSSKey(BigInteger p, BigInteger q, BigInteger g) { super(); this.p = p; this.q = q; this.g = g; }
if (c.isOpaque() && UIManager.get("MenuBar.gradient") != null)
int height = c.getHeight(); if (c.isOpaque() && UIManager.get("MenuBar.gradient") != null && c.getBackground() instanceof UIResource && height > 2)
public void update(Graphics g, JComponent c) { if (c.isOpaque() && UIManager.get("MenuBar.gradient") != null) { MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(), SwingConstants.VERTICAL, "MenuBar.gradient"); paint(g, c); } else super.upd...
MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(),
MetalUtils.paintGradient(g, 0, 0, c.getWidth(), height - 2,
public void update(Graphics g, JComponent c) { if (c.isOpaque() && UIManager.get("MenuBar.gradient") != null) { MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(), SwingConstants.VERTICAL, "MenuBar.gradient"); paint(g, c); } else super.upd...
if (_instance == null) { initialize(); _instance = this; }
System.setProperty("python.cachedir", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator); if (_instance == null) { initialize(); _instance = this; }
public GlobalConfigure() { if (_instance == null) { // initialize the settings information initialize(); // set our instance to this one. _instance = this; } }
if (noWhiteSpaceList.length() > 0) Log.errorln("Got non-whitespace character data for algorithm valueList. Ignoring."); return;
if (noWhiteSpaceList.length() > 0) { Log.errorln("Got non-whitespace character data for valueList with size attribute! Ignoring."); return; } else { Log.warnln("Got size attribute set on delimited valueList. Ignoring attribute."); }
public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // IF we get here, we have the delmited case for populating // a value list. // 1. set up information we need // our string that we will parse String valueListString = new String (buf,...
CurrentValueList.init(attribListToHashtable(attrs));
Hashtable attribs = attribListToHashtable(attrs); CurrentValueList.init(attribs);
public Object action (SaxDocumentHandler handler, Attributes attrs) { // 1. re-init CurrentValueList = new ValueList(); // 2. populate ValueListparameters from attribute list CurrentValueList.init(attribListToHashtable(attrs)); // 3. populate ValueListparameter...
CurrentValueList.setIsDelimitedCase(false);
if (attribs.containsKey("size")) CurrentValueList.setIsDelimitedCase(false); else CurrentValueList.setIsDelimitedCase(true);
public Object action (SaxDocumentHandler handler, Attributes attrs) { // 1. re-init CurrentValueList = new ValueList(); // 2. populate ValueListparameters from attribute list CurrentValueList.init(attribListToHashtable(attrs)); // 3. populate ValueListparameter...
int myValue = convertBytesToInteger (bytes_to_add, endian, data, bytes_added); CurrentArray.setData(location, myValue);
switch (bytes_to_add) { case 1: { short val = convert1byteToShort (data, bytes_added); CurrentArray.setData(location, val); break; } case 2: { short val = convert2bytesToShort (endian, data, bytes_added); CurrentArray.setData(location, val); break; } case 3: { int val = convert3bytesToInt (endian, data, bytes_added)...
private void addByteDataToCurrentArray (Locator location, byte[] data, int amount, String endian) throws SetDataException { ArrayList commandList = (ArrayList) ((FormattedXMLDataIOStyle) CurrentArray.getXMLDataIOStyle()).getFormatCommands(); int nrofIOCmd = commandList.size(); int bytes_...
*/
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat, int intRadix ) {// this stuff slows down the...
return convert1byteToInteger (bb, sbyte);
return convert1byteToInt (bb, sbyte);
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert...
return convert2bytesToInteger (endianStyle, bb, sbyte);
return convert2bytesToInt (endianStyle, bb, sbyte);
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert...
return convert3bytesToInteger (endianStyle, bb, sbyte);
return convert3bytesToInt (endianStyle, bb, sbyte);
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert...
return convert4bytesToInteger (endianStyle, bb, sbyte);
return convert4bytesToInt (endianStyle, bb, sbyte);
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert...
boolean niceOutput = sPrettyXDFOutput;
boolean niceOutput = Specification.getInstance().isPrettyXDFOutput();
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameStri...
protected void writeDelimitedData(OutputStream outputstream,
private void writeDelimitedData(OutputStream outputstream,
protected void writeDelimitedData(OutputStream outputstream, Locator locator, DelimitedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { String delimiter = readObj.getDelimiter(); S...
protected void writeFormattedData(OutputStream outputstream ,
private void writeFormattedData(OutputStream outputstream ,
protected void writeFormattedData(OutputStream outputstream , Locator locator, FormattedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { writeOut(outputstream...
if (sPrettyXDFOutput) { indent += sPrettyXDFOutputIndentation;
if (Specification.getInstance().isPrettyXDFOutput()) { indent += Specification.getInstance().getPrettyXDFOutputIndentation();
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tag...
if (sPrettyXDFOutput) {
if (Specification.getInstance().isPrettyXDFOutput()) {
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tag...
writeOut(outputstream, indent + sPrettyXDFOutputIndentation);
writeOut(outputstream, indent + Specification.getInstance().getPrettyXDFOutputIndentation());
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tag...
public synchronized void add(String item) {
add(String item) {
public synchronized void add(String item) { if (item == null) throw new NullPointerException("item must be non-null"); pItems.addElement(item); int i = pItems.size() - 1; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, i); } if (i == 0) select(0); }
if (i == 0) select(0); }
}
public synchronized void add(String item) { if (item == null) throw new NullPointerException("item must be non-null"); pItems.addElement(item); int i = pItems.size() - 1; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, i); } if (i == 0) select(0); }
public synchronized void addItem(String item) {
addItem(String item) {
public synchronized void addItem(String item) { add(item); }
public synchronized void addItemListener(ItemListener listener) {
addItemListener(ItemListener listener) {
public synchronized void addItemListener(ItemListener listener) { item_listeners = AWTEventMulticaster.add(item_listeners, listener); }
public void addNotify() {
addNotify() {
public void addNotify() { if (peer == null) peer = getToolkit().createChoice(this); super.addNotify(); }
public int countItems() { return (pItems.size()); }
countItems() { return(pItems.size()); }
public int countItems() { return (pItems.size()); }
public String getItem(int index) { return ((String) pItems.elementAt(index)); }
getItem(int index) { return((String)pItems.elementAt(index)); }
public String getItem(int index) { return ((String) pItems.elementAt(index)); }
public int getItemCount() { return (pItems.size()); }
getItemCount() { return countItems (); }
public int getItemCount() { return (pItems.size()); }
public int getSelectedIndex() { return (selectedIndex); }
getSelectedIndex() { return(selectedIndex); }
public int getSelectedIndex() { return (selectedIndex); }
public synchronized String getSelectedItem() { return (selectedIndex == -1 ? null : ((String) pItems.elementAt(selectedIndex))); }
getSelectedItem() { return (selectedIndex == -1 ? null : ((String)pItems.elementAt(selectedIndex))); }
public synchronized String getSelectedItem() { return (selectedIndex == -1 ? null : ((String) pItems.elementAt(selectedIndex))); }
public synchronized Object[] getSelectedObjects() {
getSelectedObjects() {
public synchronized Object[] getSelectedObjects() { if (selectedIndex == -1) return null; Object[] objs = new Object[1]; objs[0] = pItems.elementAt(selectedIndex); return (objs); }
public synchronized void insert(String item, int index) {
insert(String item, int index) {
public synchronized void insert(String item, int index) { if (index < 0) throw new IllegalArgumentException("index may not be less then 0"); if (index > getItemCount()) index = getItemCount(); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, index); ...
if (getItemCount() == 1 || selectedIndex >= index) select(0); }
}
public synchronized void insert(String item, int index) { if (index < 0) throw new IllegalArgumentException("index may not be less then 0"); if (index > getItemCount()) index = getItemCount(); pItems.insertElementAt(item, index); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, index); ...
protected String paramString() {
paramString() {
protected String paramString() { return ("selectedIndex=" + selectedIndex + "," + super.paramString()); }
public synchronized void remove(String item) {
remove(String item) {
public synchronized void remove(String item) { int index = pItems.indexOf(item); if (index == -1) throw new IllegalArgumentException("item \"" + item + "\" not found in Choice"); remove(index); }
public synchronized void removeAll() { int count = getItemCount();
removeAll() { if (getItemCount() <= 0) return;
public synchronized void removeAll() { int count = getItemCount(); for (int i = 0; i < count; i++) { // Always remove 0. remove(0); } }
for (int i = 0; i < count; i++) { remove(0); }
pItems.removeAllElements (); if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.removeAll ();
public synchronized void removeAll() { int count = getItemCount(); for (int i = 0; i < count; i++) { // Always remove 0. remove(0); } }
selectedIndex = -1; }
public synchronized void removeAll() { int count = getItemCount(); for (int i = 0; i < count; i++) { // Always remove 0. remove(0); } }
public synchronized void select(int index) {
select(int index) {
public synchronized void select(int index) { if ((index < 0) || (index > getItemCount())) throw new IllegalArgumentException("Bad index: " + index); this.selectedIndex = index; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.select(index); } }
cp.select(index); }
cp.select (index);
public synchronized void select(int index) { if ((index < 0) || (index > getItemCount())) throw new IllegalArgumentException("Bad index: " + index); this.selectedIndex = index; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.select(index); } }
}
public synchronized void select(int index) { if ((index < 0) || (index > getItemCount())) throw new IllegalArgumentException("Bad index: " + index); this.selectedIndex = index; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.select(index); } }
JRootPane root = SwingUtilities.getRootPane(this); if (root != null && root.getDefaultButton() == this) root.setDefaultButton(null); super.removeNotify();
public void removeNotify() { }
return ((year & 3) == 0 && (year % 100 != 0 || year % 400 == 0)) ? 29 : 28;
if ((year & 3) != 0) return 28; if (year < 1582) return 29; return ((year % 100) != 0 || (year % 400) == 0) ? 29 : 28;
private int getDaysInMonth(int month, int year) { // Most of this is copied from GregorianCalendar.getActualMaximum() if (month == Calendar.FEBRUARY) { return ((year & 3) == 0 && (year % 100 != 0 || year % 400 == 0)) ? 29 : 28; } else if (month < Calendar.AUGUST) return 31 - (month & 1); ...
else if (month < Calendar.AUGUST) return 31 - (month & 1);
private int getDaysInMonth(int month, int year) { // Most of this is copied from GregorianCalendar.getActualMaximum() if (month == Calendar.FEBRUARY) { return ((year & 3) == 0 && (year % 100 != 0 || year % 400 == 0)) ? 29 : 28; } else if (month < Calendar.AUGUST) return 31 - (month & 1); ...
return 30 + (month & 1);
return monthArr[month];
private int getDaysInMonth(int month, int year) { // Most of this is copied from GregorianCalendar.getActualMaximum() if (month == Calendar.FEBRUARY) { return ((year & 3) == 0 && (year % 100 != 0 || year % 400 == 0)) ? 29 : 28; } else if (month < Calendar.AUGUST) return 31 - (month & 1); ...
throw new IllegalArgumentException("month out of range");
throw new IllegalArgumentException("month out of range:" + month);
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) ...
{
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) ...
}
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { int daysInMonth = getDaysInMonth(month, year); if (day < 1 || day > daysInMonth) throw new IllegalArgumentException("day out of range"); if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) ...
return getScrollableUnitIncrement(visibleRect, orientation, direction);
int block; if (orientation == SwingConstants.VERTICAL) block = visibleRect.height; else block = visibleRect.width; return block;
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { return getScrollableUnitIncrement(visibleRect, orientation, direction); }
int delta;
int delta = 0;
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int delta; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // One pixel down, otherwise picks another row...
int row = getClosestRowForLocation(visibleRect.x, visibleRect.y + 1); row = row + direction; if (row < 0) row = 0; Rectangle newTop = getRowBounds(row); delta = newTop.y - visibleRect.y;
int row = getClosestRowForLocation(0, visibleRect.y); if (row != -1) { Rectangle b = getRowBounds(row); if (b.y != visibleRect.y) { if (direction < 0) delta = Math.max(0, visibleRect.y - b.y); else delta = b.y + b.height - visibleRect.height;
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int delta; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // One pixel down, otherwise picks another row...
delta = direction * rowHeight == 0 ? 20 : rowHeight;
{ if (direction < 0) { if (row != 0) { b = getRowBounds(row - 1); delta = b.height; } } else delta = b.height; } } } else delta = 4;
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int delta; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // One pixel down, otherwise picks another row...
if (selectionModel != null)
public void setSelectionModel(TreeSelectionModel model) { if (selectionModel == model) return; if (selectionModel != null) selectionModel.removeTreeSelectionListener(selectionRedirector); TreeSelectionModel oldValue = selectionModel; selectionModel = model; if (selectionModel != null) s...
private LongItem(int kind, int offsetToFP, Register lsb, Register msb, long val) { super(kind, offsetToFP, lsb, msb); this.value = val; }
LongItem(ItemFactory factory) { super(factory); }
private LongItem(int kind, int offsetToFP, Register lsb, Register msb, long val) { super(kind, offsetToFP, lsb, msb); this.value = val; }
return createConst(getValue()); }
return factory.createLConst(getValue()); }
protected DoubleWordItem cloneConstant() { return createConst(getValue()); }
inhibitedRectangle = null;
private void clearLayout() { locationRectangle = null; }
inhibitedRectangle = new Rectangle(10, 0, 25* this.columnWidth, this.rowHeight);
private void doLayout() { if (locationRectangle == null) { Rectangle bounds = this.getBounds(); int x,y,w,h; // Location rectangle w = 6 * this.columnWidth; locationRectangle = new Rectangle(bounds.width - w, 0, w, this.rowHeight); } }
addDirtyRectangle(inhibitedRectangle);
public void onOIAChanged(ScreenOIA oia, int change) { switch (change) { case OIA_CHANGED_BELL: ringAudibleBell(); break; case OIA_CHANGED_CLEAR_SCREEN: break; case OIA_CHANGED_INPUTINHIBITED: break; case OIA_CHANGED_INSERT_MODE: break; ...
paintInhibited(g, clip);
public void paintComponent(Graphics g) { doLayout(); Rectangle clip = g.getClipBounds(); paintRuler(g, clip); paintLocation(g, clip); }
set.removeAttributes(set);
protected void createInputAttributes(Element element, MutableAttributeSet set) { // FIXME: Filter out component, icon and element name attributes. set.addAttributes(element.getAttributes()); }
throw new IOException ("No entry for " + entry_name + " exists.");
throw new FileNotFoundException("No entry for " + entry_name + " exists.");
public synchronized void connect() throws IOException { // Call is ignored if already connected. if (connected) return; jar_url = getJarFileURL(); jar_file = JarFileCache.get (jar_url, useCaches); String entry_name = getEntryName(); if (entry_name != null && !entry_name.equals (""))...
if (jar_entry == null) throw new IOException (jar_url + " couldn't be found.");
public InputStream getInputStream() throws IOException { if (!connected) connect(); if (! doInput) throw new ProtocolException("Can't open InputStream if doInput is false"); if (jar_entry == null) throw new IOException (jar_url + " couldn't be found."); return jar_file.getInputStre...
return new MetalComboBoxButton(comboBox, new MetalComboBoxIcon(),
JButton button = new MetalComboBoxButton(comboBox, new MetalComboBoxIcon(),
protected JButton createArrowButton() { return new MetalComboBoxButton(comboBox, new MetalComboBoxIcon(), new CellRendererPane(), listBox); }
button.setMargin(new Insets(0, 1, 1, 3)); return button;
protected JButton createArrowButton() { return new MetalComboBoxButton(comboBox, new MetalComboBoxIcon(), new CellRendererPane(), listBox); }
arrowButton.setText(comboBox.getSelectedItem().toString());
String text = ""; Object selected = comboBox.getSelectedItem(); if (selected != null) text = selected.toString(); arrowButton.setText(text);
protected void editablePropertyChanged(PropertyChangeEvent e) { if (arrowButton instanceof MetalComboBoxButton) { MetalComboBoxButton b = (MetalComboBoxButton) arrowButton; b.setIconOnly(comboBox.isEditable()); } if (comboBox.isEditable()) { arrowButton.setText(null); ...
Dimension result = super.getMinimumSize(c); result.height = result.height + 9; return result;
MetalComboBoxButton b = (MetalComboBoxButton) arrowButton; Icon icon = b.getComboIcon(); Insets insets = b.getInsets(); Dimension d = getDisplaySize(); int insetsH = insets.top + insets.bottom; int insetsW = insets.left + insets.right; int iconWidth = icon.getIconWidth() + 6; return new Dimension(d.width + insetsW + ic...
public Dimension getMinimumSize(JComponent c) { // FIXME: this needs work Dimension result = super.getMinimumSize(c); result.height = result.height + 9; return result; }
public void propertyChange(PropertyChangeEvent event) { String name = event.getPropertyName();
String name = event.getPropertyName();
protected PropertyChangeListener createActionPropertyChangeListener(Action action) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { // Update properties "action" and "horizontalAlignment". String name = event.getPropertyName(); if (name.equals("enabled")) ...
Class.forName(ObjectCreator.toHelperName(type.id()));
ObjectCreator.forName(ObjectCreator.toHelperName(type.id()));
void findHelper() { if (helper != null || helper_NA) return; try { Class helperClass = Class.forName(ObjectCreator.toHelperName(type.id())); helper = (BoxedValueHelper) helperClass.newInstance(); } catch (Exception ex) { helper_NA = true; } }
public void send() throws Exception, AddressException, MessagingException {
public boolean send() throws Exception, AddressException, MessagingException {
public void send() throws Exception, AddressException, MessagingException {// try { if(!loadConfig(configFile)) return; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Mult...
try {
public void send() throws Exception, AddressException, MessagingException {// try { if(!loadConfig(configFile)) return; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Mult...
return;
return false;
public void send() throws Exception, AddressException, MessagingException {// try { if(!loadConfig(configFile)) return; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Mult...
return true; } catch (SendFailedException sfe) { showFailedException(sfe); } return false;
public void send() throws Exception, AddressException, MessagingException {// try { if(!loadConfig(configFile)) return; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Mult...
throw new BAD_OPERATION();
BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); bad.minor = Minor.Any; throw bad;
public static NotEmpty extract(Any a) { try { return ((NotEmptyHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION(); } }
if (obj!=null) { if (memberObjHash.add(obj)) return obj; else return null; }
if (memberObjHash.add(obj)) return obj;
public Object addMemberObject (Object obj) { if (obj!=null) { if (memberObjHash.add(obj)) return obj; else return null; } else return null; }
if (obj!=null) { if (memberObjHash.contains(obj)) { return true; } else return false;
if (memberObjHash.contains(obj)) { return true;
public boolean hasMemberObj (Object obj) { if (obj!=null) { if (memberObjHash.contains(obj)) { return true; } else return false; } return false; }