bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
protected Tag(String id) { name = id; flags = 0; }
|
public Tag() { name = id; flags = 0; }
| 6,534
|
protected Tag(String id) { name = id; flags = 0; }
|
protected Tag(String id) { name = null; flags = 0; }
| 6,535
|
public void show() { // We insert a JPanel between the layered pane and the contents so we // can fiddle with the setLocation() method without disturbing a // JPopupMenu (which overrides setLocation in an unusual manner). if (panel == null) { panel = new JPanel(); panel.setLayout(null); } panel.add(contents); panel.setSize(contents.getSize()); Point layeredPaneLoc = layeredPane.getLocationOnScreen(); panel.setLocation(x - layeredPaneLoc.x, y - layeredPaneLoc.y); layeredPane.add(panel, JLayeredPane.POPUP_LAYER); }
|
public void show() { // We insert a JPanel between the layered pane and the contents so we // can fiddle with the setLocation() method without disturbing a // JPopupMenu (which overrides setLocation in an unusual manner). if (panel == null) { panel = new JPanel(); panel.setLayout(new FlowLayout(0, 0, 0)); } panel.add(contents); panel.setSize(contents.getSize()); Point layeredPaneLoc = layeredPane.getLocationOnScreen(); panel.setLocation(x - layeredPaneLoc.x, y - layeredPaneLoc.y); layeredPane.add(panel, JLayeredPane.POPUP_LAYER); }
| 6,536
|
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); // The current x and y pixel coordinates. int pixelX = x; int pixelY = y - ascent; int pixelWidth = 0; int pos = s.offset; int len = 0; int end = s.offset + s.count; for (int offset = s.offset; offset < end; ++offset) { char c = buffer[offset]; if (c == '\t' || c == '\n') { if (len > 0) { g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0; } pos = offset+1; len = 0; } switch (c) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of ' '. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must jump to the next line. pixelY += metrics.getHeight(); pixelX = x; break; default: ++len; pixelWidth += metrics.charWidth(buffer[offset]); break; } } if (len > 0) g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); return pixelX + pixelWidth; }
|
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); // The current x and y pixel coordinates. int pixelX = x; int pixelY = y - ascent; int pixelWidth = 0; int pos = s.offset; int len = 0; int end = s.offset + s.count; for (int offset = s.offset; offset < end; ++offset) { char c = buffer[offset]; if (c == '\t') { if (len > 0) { g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0; } pos = offset+1; len = 0; } switch (c) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of ' '. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must jump to the next line. pixelY += metrics.getHeight(); pixelX = x; break; default: ++len; pixelWidth += metrics.charWidth(buffer[offset]); break; } } if (len > 0) g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); return pixelX + pixelWidth; }
| 6,537
|
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); // The current x and y pixel coordinates. int pixelX = x; int pixelY = y - ascent; int pixelWidth = 0; int pos = s.offset; int len = 0; int end = s.offset + s.count; for (int offset = s.offset; offset < end; ++offset) { char c = buffer[offset]; if (c == '\t' || c == '\n') { if (len > 0) { g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0; } pos = offset+1; len = 0; } switch (c) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of ' '. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must jump to the next line. pixelY += metrics.getHeight(); pixelX = x; break; default: ++len; pixelWidth += metrics.charWidth(buffer[offset]); break; } } if (len > 0) g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); return pixelX + pixelWidth; }
|
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); // The current x and y pixel coordinates. int pixelX = x; int pixelY = y - ascent; int pixelWidth = 0; int pos = s.offset; int len = 0; int end = s.offset + s.count; for (int offset = s.offset; offset < end; ++offset) { char c = buffer[offset]; if (c == '\t' || c == '\n') { if (len > 0) { g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0; } pos = offset+1; len = 0; } switch (c) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of ' '. if (e != null) pixelX = (int) e.nextTabStop(pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must jump to the next line. pixelY += metrics.getHeight(); pixelX = x; break; default: ++len; pixelWidth += metrics.charWidth(buffer[offset]); break; } } if (len > 0) g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); return pixelX + pixelWidth; }
| 6,538
|
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); // The current x and y pixel coordinates. int pixelX = x; int pixelY = y - ascent; int pixelWidth = 0; int pos = s.offset; int len = 0; int end = s.offset + s.count; for (int offset = s.offset; offset < end; ++offset) { char c = buffer[offset]; if (c == '\t' || c == '\n') { if (len > 0) { g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0; } pos = offset+1; len = 0; } switch (c) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of ' '. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must jump to the next line. pixelY += metrics.getHeight(); pixelX = x; break; default: ++len; pixelWidth += metrics.charWidth(buffer[offset]); break; } } if (len > 0) g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); return pixelX + pixelWidth; }
|
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); // The current x and y pixel coordinates. int pixelX = x; int pixelY = y - ascent; int pixelWidth = 0; int pos = s.offset; int len = 0; int end = s.offset + s.count; for (int offset = s.offset; offset < end; ++offset) { char c = buffer[offset]; if (c == '\t' || c == '\n') { if (len > 0) { g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0; } pos = offset+1; len = 0; } switch (c) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of ' '. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must jump to the next line. pixelY += metrics.getHeight(); pixelX = x; break; default: ++len; pixelWidth += metrics.charWidth(buffer[offset]); break; } } if (len > 0) g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); return pixelX + pixelWidth; }
| 6,539
|
public static final int getBreakLocation(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset) { int mark = Utilities.getTabbedTextOffset(s, metrics, x0, x, e, startOffset, false); BreakIterator breaker = BreakIterator.getWordInstance(); breaker.setText(s); // If startOffset and s.offset differ then we need to use // that difference two convert the offset between the two metrics. int shift = startOffset - s.offset; // If mark is equal to the end of the string, just use that position. if (mark >= shift + s.count) return mark; // Try to find a word boundary previous to the mark at which we // can break the text. int preceding = breaker.preceding(mark + 1 - shift); if (preceding != 0) return preceding + shift; // If preceding is 0 we couldn't find a suitable word-boundary so // just break it on the character boundary return mark; }
|
public static final int getBreakLocation(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset) { int mark = Utilities.getTabbedTextOffset(s, metrics, x0, x, e, startOffset, false); BreakIterator breaker = BreakIterator.getWordInstance(); breaker.setText(s); // If startOffset and s.offset differ then we need to use // that difference two convert the offset between the two metrics. int shift = startOffset - s.offset; // If mark is equal to the end of the string, just use that position. if (mark >= shift + s.count) return mark; // Try to find a word boundary previous to the mark at which we // can break the text. int preceding = breaker.preceding(mark + 1 + s.offset); if (preceding != 0) return preceding + shift; // If preceding is 0 we couldn't find a suitable word-boundary so // just break it on the character boundary return mark; }
| 6,540
|
static int getNextVisualPositionFrom(JTextComponent t, int offset, int direction) { NavigationFilter nf = t.getNavigationFilter(); try { return (nf != null) ? nf.getNextVisualPositionFrom(t, offset, Bias.Forward, direction, null) : t.getUI().getNextVisualPositionFrom(t, offset, Bias.Forward, direction, null); } catch (BadLocationException ble) { return offset; } }
|
static int getNextVisualPositionFrom(JTextComponent t, int offset, int direction) { NavigationFilter nf = t.getNavigationFilter(); try { return (nf != new Position.Bias[1]) ? nf.getNextVisualPositionFrom(t, offset, Bias.Forward, direction, new Position.Bias[1]) : t.getUI().getNextVisualPositionFrom(t, offset, Bias.Forward, direction, new Position.Bias[1]); } catch (BadLocationException ble) { return offset; } }
| 6,541
|
static int getNextVisualPositionFrom(JTextComponent t, int offset, int direction) { NavigationFilter nf = t.getNavigationFilter(); try { return (nf != null) ? nf.getNextVisualPositionFrom(t, offset, Bias.Forward, direction, null) : t.getUI().getNextVisualPositionFrom(t, offset, Bias.Forward, direction, null); } catch (BadLocationException ble) { return offset; } }
|
static int getNextVisualPositionFrom(JTextComponent t, int offset, int direction) { NavigationFilter nf = t.getNavigationFilter(); try { return (nf != null) ? nf.getNextVisualPositionFrom(t, offset, Bias.Forward, direction, null) : t.getUI().getNextVisualPositionFrom(t, offset, Bias.Forward, direction, new Position.Bias[1]); } catch (BadLocationException ble) { return offset; } }
| 6,542
|
public static final int getTabbedTextOffset(Segment s, FontMetrics fm, int x0, int x, TabExpander te, int p0, boolean round) { // At the end of the for loop, this holds the requested model location int pos; int currentX = x0; int width = 0; for (pos = 0; pos < s.count; pos++) { char nextChar = s.array[s.offset+pos]; if (nextChar == 0) break; if (nextChar != '\t') width = fm.charWidth(nextChar); else { if (te == null) width = fm.charWidth(' '); else width = ((int) te.nextTabStop(currentX, pos)) - currentX; } if (round) { if (currentX + (width>>1) > x) break; } else { if (currentX + width > x) break; } currentX += width; } return pos + p0; }
|
public static final int getTabbedTextOffset(Segment s, FontMetrics fm, int x0, int x, TabExpander te, int p0, boolean round) { // At the end of the for loop, this holds the requested model location int pos; int currentX = x0; int width = 0; for (pos = 0; pos < s.count; pos++) { char nextChar = s.array[s.offset+pos]; if (nextChar == 0) break; if (nextChar != '\t') width = fm.charWidth(nextChar); else { if (te == null) width = fm.charWidth(' '); else width = ((int) te.nextTabStop(currentX, pos)) - currentX; } if (round) { if (currentX + (width>>1) > x) break; } else { if (currentX + width > x) break; } currentX += width; } return pos; }
| 6,543
|
public static final int getTabbedTextWidth(Segment s, FontMetrics metrics, int x, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The current x coordinate. int pixelX = x; // The current maximum width. int maxWidth = 0; for (int offset = s.offset; offset < (s.offset + s.count); ++offset) { switch (buffer[offset]) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of 'm'. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must 'draw' // the buffer and jump on the next line. pixelX += metrics.charWidth(buffer[offset]); maxWidth = Math.max(maxWidth, pixelX - x); pixelX = x; break; default: // Here we draw the char. pixelX += metrics.charWidth(buffer[offset]); break; } } // Take the last line into account. maxWidth = Math.max(maxWidth, pixelX - x); return maxWidth; }
|
public static final int getTabbedTextWidth(Segment s, FontMetrics metrics, int x, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The current x coordinate. int pixelX = x; // The current maximum width. int maxWidth = 0; for (int offset = s.offset; offset < (s.offset + s.count); ++offset) { switch (buffer[offset]) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of 'm'. if (e != null) pixelX = (int) e.nextTabStop(pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must 'draw' // the buffer and jump on the next line. pixelX += metrics.charWidth(buffer[offset]); maxWidth = Math.max(maxWidth, pixelX - x); pixelX = x; break; default: // Here we draw the char. pixelX += metrics.charWidth(buffer[offset]); break; } } // Take the last line into account. maxWidth = Math.max(maxWidth, pixelX - x); return maxWidth; }
| 6,544
|
protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException { g.setColor(unselectedColor); Segment segment = new Segment(); getDocument().getText(p0, p1 - p0, segment); return Utilities.drawTabbedText(segment, x, y, g, this, 0); }
|
protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException { g.setColor(unselectedColor); Segment segment = new Segment(); getDocument().getText(p0, p1 - p0, segment); return Utilities.drawTabbedText(segment, x, y, g, this, segment.offset); }
| 6,545
|
public void setBoundsForFrame(JComponent f, int x, int y, int w, int h) { System.out.println(" we are adjusting "); if (f instanceof MyInternalFrame == false) { super.setBoundsForFrame(f, x, y, w, h); // only deal w/internal frames } else { MyInternalFrame frame = (MyInternalFrame)f; // Figure out if we are being resized (otherwise it's just a move) boolean resizing = false; Object r = frame.getClientProperty(RESIZING); if (r != null && r instanceof Boolean) { resizing = ((Boolean)r).booleanValue(); } JDesktopPane desk = frame.getDesktopPane(); Dimension d = desk.getSize(); // Nothing all that fancy below, just figuring out how to adjust // to keep the frame on the desktop. if (x < 0) { // too far left? if (resizing) w += x; // don't get wider! x=0; // flush against the left side } else { if (x+w>d.width) { // too far right? if (resizing) w = d.width-x; // don't get wider! else x = d.width-w; // flush against the right side } } if (y < 0) { // too high? if (resizing) h += y; // don't get taller! y=0; // flush against the top } else { if (y+h > d.height) { // too low? if (resizing) h = d.height - y; // don't get taller! else y = d.height-h; // flush against the bottom } } // Set 'em the way we like 'em super.setBoundsForFrame(f, x, y, w, h);// ((MyInternalFrame)f).resizeMe(); } }
|
public void setBoundsForFrame(JComponent f, int x, int y, int w, int h) { log.info(" we are adjusting "); if (f instanceof MyInternalFrame == false) { super.setBoundsForFrame(f, x, y, w, h); // only deal w/internal frames } else { MyInternalFrame frame = (MyInternalFrame)f; // Figure out if we are being resized (otherwise it's just a move) boolean resizing = false; Object r = frame.getClientProperty(RESIZING); if (r != null && r instanceof Boolean) { resizing = ((Boolean)r).booleanValue(); } JDesktopPane desk = frame.getDesktopPane(); Dimension d = desk.getSize(); // Nothing all that fancy below, just figuring out how to adjust // to keep the frame on the desktop. if (x < 0) { // too far left? if (resizing) w += x; // don't get wider! x=0; // flush against the left side } else { if (x+w>d.width) { // too far right? if (resizing) w = d.width-x; // don't get wider! else x = d.width-w; // flush against the right side } } if (y < 0) { // too high? if (resizing) h += y; // don't get taller! y=0; // flush against the top } else { if (y+h > d.height) { // too low? if (resizing) h = d.height - y; // don't get taller! else y = d.height-h; // flush against the bottom } } // Set 'em the way we like 'em super.setBoundsForFrame(f, x, y, w, h);// ((MyInternalFrame)f).resizeMe(); } }
| 6,546
|
public Gui5250MDIFrame(My5250 m) { super(m); enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } }
|
public Gui5250MDIFrame(My5250 m) { super(m); enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { log.warn("In constructor: "+e); } }
| 6,547
|
public void addSessionView(String tabText,Session session) { MyInternalFrame frame = new MyInternalFrame(); frame.setVisible(true); desktop.add(frame); myFrameList.add(frame); selectedIndex = desktop.getComponentCount(); frame.setContentPane(session); try { frame.setSelected(true); } catch (java.beans.PropertyVetoException e) {} session.addSessionListener(this); session.addSessionJumpListener(this); try { frame.setMaximum(true); } catch (java.beans.PropertyVetoException pve) { System.out.println("Can not set maximum " + pve.getMessage()); } }
|
public void addSessionView(String tabText,Session session) { MyInternalFrame frame = new MyInternalFrame(); frame.setVisible(true); desktop.add(frame); myFrameList.add(frame); selectedIndex = desktop.getComponentCount(); frame.setContentPane(session); try { frame.setSelected(true); } catch (java.beans.PropertyVetoException e) {} session.addSessionListener(this); session.addSessionJumpListener(this); try { frame.setMaximum(true); } catch (java.beans.PropertyVetoException pve) { log.warn("Can not set maximum " + pve.getMessage()); } }
| 6,548
|
private void nextSession() { MyInternalFrame mif = getNextInternalFrame(); if (mif != null) { try { if (mif.isIcon()) { mif.setIcon(false); } mif.setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } }// System.out.println(" current index " + index + " count " + desktop.getComponentCount()); }
|
private void nextSession() { MyInternalFrame mif = getNextInternalFrame(); if (mif != null) { try { if (mif.isIcon()) { mif.setIcon(false); } mif.setSelected(true); } catch (java.beans.PropertyVetoException e) { log.warn(e.getMessage()); } }// System.out.println(" current index " + index + " count " + desktop.getComponentCount()); }
| 6,550
|
public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getState() + " " + d); final int index = getIndexOfSession(ses);// System.out.println(" index of session " + index + " num frames " + desktop.getAllFrames().length); if (index == -1) return; Runnable tc = new Runnable () { public void run() { JInternalFrame[] frames = desktop.getAllFrames(); int id = ((MyInternalFrame)frames[index]).getInternalId(); frames[index].setTitle("#" + id + " " + d); } }; SwingUtilities.invokeLater(tc); } break; } }
|
public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { log.info(changeEvent.getState() + " " + d); final int index = getIndexOfSession(ses);// System.out.println(" index of session " + index + " num frames " + desktop.getAllFrames().length); if (index == -1) return; Runnable tc = new Runnable () { public void run() { JInternalFrame[] frames = desktop.getAllFrames(); int id = ((MyInternalFrame)frames[index]).getInternalId(); frames[index].setTitle("#" + id + " " + d); } }; SwingUtilities.invokeLater(tc); } break; } }
| 6,551
|
private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); if (miv == null) return; int index = desktop.getIndexOf(miv); if (index == -1) return; MyInternalFrame mix = (MyInternalFrame)frames[index]; int seq = mix.getInternalId(); index = 0; for (int x = 0; x < myFrameList.size(); x++) { MyInternalFrame mif = (MyInternalFrame)myFrameList.get(x);// System.out.println(" current index " + x + " count " + frames.length + " has focus " +// mif.isActive() + " title " + mif.getTitle() + " seq " + seq +// " id " + mif.getInternalId()); if (mix.equals(mif)) { index = x - 1; break; } } if (index < 0) { index = myFrameList.size() - 1; } try { MyInternalFrame mif = (MyInternalFrame)myFrameList.get(index); if (mif.isIcon()) { mif.setIcon(false); } mif.setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); }// System.out.println(" current index " + index + " count " + desktop.getComponentCount()); }
|
private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); if (miv == null) return; int index = desktop.getIndexOf(miv); if (index == -1) return; MyInternalFrame mix = (MyInternalFrame)frames[index]; int seq = mix.getInternalId(); index = 0; for (int x = 0; x < myFrameList.size(); x++) { MyInternalFrame mif = (MyInternalFrame)myFrameList.get(x);// System.out.println(" current index " + x + " count " + frames.length + " has focus " +// mif.isActive() + " title " + mif.getTitle() + " seq " + seq +// " id " + mif.getInternalId()); if (mix.equals(mif)) { index = x - 1; break; } } if (index < 0) { index = myFrameList.size() - 1; } try { MyInternalFrame mif = (MyInternalFrame)myFrameList.get(index); if (mif.isIcon()) { mif.setIcon(false); } mif.setSelected(true); } catch (java.beans.PropertyVetoException e) { log.warn(e.getMessage()); }// System.out.println(" current index " + index + " count " + desktop.getComponentCount()); }
| 6,554
|
public void removeSessionView(Session targetSession) { int index = getIndexOfSession(targetSession); MyInternalFrame nextMIF = getNextInternalFrame(); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); MyInternalFrame mif = (MyInternalFrame)frames[index]; int count = getSessionViewCount();// System.out.println(" num of frames before removal " + myFrameList.size()); myFrameList.remove(mif);// System.out.println(" num of frames left " + myFrameList.size()); desktop.remove(index); if (nextMIF != null) { try { nextMIF.setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } this.repaint(); }
|
public void removeSessionView(Session targetSession) { int index = getIndexOfSession(targetSession); MyInternalFrame nextMIF = getNextInternalFrame(); log.info("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); MyInternalFrame mif = (MyInternalFrame)frames[index]; int count = getSessionViewCount();// System.out.println(" num of frames before removal " + myFrameList.size()); myFrameList.remove(mif);// System.out.println(" num of frames left " + myFrameList.size()); desktop.remove(index); if (nextMIF != null) { try { nextMIF.setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } this.repaint(); }
| 6,555
|
public void removeSessionView(Session targetSession) { int index = getIndexOfSession(targetSession); MyInternalFrame nextMIF = getNextInternalFrame(); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); MyInternalFrame mif = (MyInternalFrame)frames[index]; int count = getSessionViewCount();// System.out.println(" num of frames before removal " + myFrameList.size()); myFrameList.remove(mif);// System.out.println(" num of frames left " + myFrameList.size()); desktop.remove(index); if (nextMIF != null) { try { nextMIF.setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } this.repaint(); }
|
public void removeSessionView(Session targetSession) { int index = getIndexOfSession(targetSession); MyInternalFrame nextMIF = getNextInternalFrame(); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); MyInternalFrame mif = (MyInternalFrame)frames[index]; int count = getSessionViewCount();// System.out.println(" num of frames before removal " + myFrameList.size()); myFrameList.remove(mif);// System.out.println(" num of frames left " + myFrameList.size()); desktop.remove(index); if (nextMIF != null) { try { nextMIF.setSelected(true); } catch (java.beans.PropertyVetoException e) { log.warn(e.getMessage()); } } this.repaint(); }
| 6,558
|
public DebugState process(KeyboardEvent event) { DebugState newState = this; switch (event.getKeyChar()) { case 'n': if (threadIterator.hasNext()) { final Thread t = (Thread) threadIterator.next(); newState = new ThreadState(this, t, index++); } break; case 'r': threadIterator = threads.values().iterator(); index = 1; break; default: return this; } event.consume(); return newState; }
|
public DebugState process(KeyboardEvent event) { DebugState newState = this; switch (event.getKeyChar()) { case 'n': if (threadIterator.hasNext()) { final Thread t = (Thread) threadIterator.next(); newState = new ThreadState(this, t, index++); } break; case 'r': threadIterator = threads.values().iterator(); index = 1; break; default: return this; } event.consume(); return newState; }
| 6,559
|
protected void addImpl(Component comp, Object constraints, int index) { // If we're adding in the initialization stage use super.add. // Otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not add directly to JDialog." + " Use getContentPane().add instead."); getContentPane().add(comp, constraints, index); } }
|
protected void addImpl(Component comp, Object constraints, int index) { // If we're adding in the initialization stage use super.add. // Otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not add directly to JDialog." + " Use getContentPane().add instead."); getContentPane().add(comp, constraints, index); } }
| 6,560
|
protected void addImpl(Component comp, Object constraints, int index) { // If we're adding in the initialization stage use super.add. // Otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not add directly to JDialog." + " Use getContentPane().add instead."); getContentPane().add(comp, constraints, index); } }
|
protected void addImpl(Component comp, Object constraints, int index) { // If we're adding in the initialization stage use super.add. // Otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not add directly to JDialog." + " Use getContentPane().add instead."); getContentPane().add(comp, constraints, index); } }
| 6,561
|
protected void dialogInit() { // FIXME: Do a check on GraphicsEnvironment.isHeadless() setLocale(JComponent.getDefaultLocale()); getRootPane(); // Will do set/create. invalidate(); // Now that initStageDone is true, adds and layouts apply to contentPane, // not top-level. initStageDone = true; }
|
protected void dialogInit() { // FIXME: Do a check on GraphicsEnvironment.isHeadless() setLocale(JComponent.getDefaultLocale()); getRootPane(); // Will do set/create. invalidate(); // Now that initStageDone is true, adds and layouts apply to contentPane, // not top-level. setRootPaneCheckingEnabled(true); }
| 6,562
|
public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set top-level layout. Use" + " getConentPane().setLayout instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); }
|
public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set top-level layout. Use" + " getConentPane().setLayout instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); }
| 6,563
|
public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set top-level layout. Use" + " getConentPane().setLayout instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); }
|
public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set top-level layout. Use" + " getConentPane().setLayout instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); }
| 6,564
|
public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set top-level layout. Use" + " getConentPane().setLayout instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); }
|
public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set top-level layout. Use" + " getConentPane().setLayout instead."); getContentPane().setLayout(manager); else super.setLayout(manager);
| 6,565
|
public static void main(String[] args) { int port = PORT; String iorf = null; try { // Create and initialize the ORB final Functional_ORB orb = new Functional_ORB(); orb.setPort(PORT); orb.init(args, null); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); orb.connect(namer, getDefaultKey()); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args [ i ].endsWith("ORBInitialPort")) port = Integer.parseInt(args [ i + 1 ]); if (args [ i ].equals("-ior")) iorf = args [ i + 1 ]; } orb.setPort(port); // Storing the IOR reference. String ior = orb.object_to_string(namer); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath, transient naming service. " + "Copyright (C) 2005 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior ); new Thread() { public void run() { // wait for invocations from clients orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } }
|
public static void main(String[] args) { int port = PORT; String iorf = null; try { // Create and initialize the ORB final Functional_ORB orb = new Functional_ORB(); orb.setPort(PORT); orb.init(args, null); // Create the servant and register it with the ORB NamingContextExt namer = new Ext(new TransientContext()); orb.connect(namer, getDefaultKey()); if (args.length > 1) for (int i = 0; i < args.length - 1; i++) { if (args [ i ].endsWith("ORBInitialPort")) port = Integer.parseInt(args [ i + 1 ]); if (args [ i ].equals("-ior")) iorf = args [ i + 1 ]; } orb.setPort(port); // Storing the IOR reference. String ior = orb.object_to_string(namer); if (iorf != null) { FileOutputStream f = new FileOutputStream(iorf); PrintStream p = new PrintStream(f); p.print(ior); p.close(); } System.out.println("GNU Classpath, transient naming service. " + "Copyright (C) 2005 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " + "GNU Classpath license.\n\n" + ior ); new Thread() { public void run() { // wait for invocations from clients orb.run(); } }.start(); } catch (Exception e) { System.err.println("ERROR: " + e); e.printStackTrace(System.out); } }
| 6,571
|
public String getUnprocessedKeyStroked() { if(index >= length)// if (keyStrokes.length() == 0) return null; else {// return keyStrokes.toString(); String ks = keyStrokes.substring(index); keyStrokes.setLength(0); return ks; } }
|
public String getUnprocessedKeyStroked() { if(index >= length)// if (keyStrokes.length() == 0) return null; else {// return keyStrokes.toString(); String ks = keyStrokes.substring(index); keyStrokes.setLength(0); return ks; } }
| 6,573
|
public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; }
|
public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index + " len " + length ); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index + " len " + length ); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index + " len " + length ); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index + " len " + length ); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; }
| 6,574
|
public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; }
|
public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was incomplete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; }
| 6,575
|
public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; }
|
public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was incomplete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; }
| 6,576
|
public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; }
|
public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; }
| 6,577
|
public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; }
|
public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; }
| 6,578
|
public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; }
|
public String nextKeyStroke() { String s = null; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was not not complete ending not found :3 " + "at position " + index); } c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was not complete beginning not found :4 " + "at position " + index); } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb);// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); keyStrokes.delete(start,index); index = 0; length = keyStrokes.length();// System.out.println("next before "+ keyStrokes + " " + start + " " + index + " " + length); } }// System.out.println("next "+ keyStrokes); return s; }
| 6,579
|
public void setKeyStrokes (String strokes) { if (strokes != null) {// keyStrokes.setLength(0); keyStrokes.append(strokes);// System.out.println("set "+ keyStrokes);// index = 0; length = keyStrokes.length(); } else { keyStrokes = new StringBuffer(); sb = new StringBuffer(); index = 0; length = 0; } }
|
public void setKeyStrokes (String strokes) { if (strokes != null) {// keyStrokes.setLength(0); keyStrokes.setLength(0);// System.out.println("set "+ keyStrokes);// index = 0; length = keyStrokes.length(); } else { keyStrokes = new StringBuffer(); sb = new StringBuffer(); index = 0; length = 0; } }
| 6,580
|
public void setKeyStrokes (String strokes) { if (strokes != null) {// keyStrokes.setLength(0); keyStrokes.append(strokes);// System.out.println("set "+ keyStrokes);// index = 0; length = keyStrokes.length(); } else { keyStrokes = new StringBuffer(); sb = new StringBuffer(); index = 0; length = 0; } }
|
public void setKeyStrokes (String strokes) { if (strokes != null) {// keyStrokes.setLength(0); keyStrokes.append(strokes);// System.out.println("set "+ keyStrokes);// index = 0; length = strokes.length(); } else { keyStrokes = new StringBuffer(); sb = new StringBuffer(); index = 0; length = 0; } }
| 6,581
|
public void setKeyStrokes (String strokes) { if (strokes != null) {// keyStrokes.setLength(0); keyStrokes.append(strokes);// System.out.println("set "+ keyStrokes);// index = 0; length = keyStrokes.length(); } else { keyStrokes = new StringBuffer(); sb = new StringBuffer(); index = 0; length = 0; } }
|
public void setKeyStrokes (String strokes) { if (strokes != null) {// keyStrokes.setLength(0); keyStrokes.append(strokes);// System.out.println("set "+ keyStrokes);// index = 0; length = keyStrokes.length(); } else { keyStrokes = new StringBuffer(); sb = new StringBuffer(); index = 0; length = 0; } }
| 6,582
|
public static boolean isJavaMIMEType (String name) { return false; }
|
public static boolean isJavaMIMEType (String name) { return (name != null && name.startsWith(GNU_JAVA_MIME_PREFIX)); }
| 6,589
|
private void closeSession() { vt.isOnSignoffScreen(); Object[] message = new Object[1]; message[0] = LangTool.getString("cs.message"); String[] options = {LangTool.getString("cs.optThis"), LangTool.getString("cs.optAll"), LangTool.getString("cs.optCancel")}; int result = JOptionPane.showOptionDialog( this.getParent(), // the parent that the dialog blocks message, // the dialog message array LangTool.getString("cs.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); if (result == 0) { closeMe(); } if (result == 1) { me.closingDown((Session)this); } }
|
private void closeSession() { Object[] message = new Object[1]; message[0] = LangTool.getString("cs.message"); String[] options = {LangTool.getString("cs.optThis"), LangTool.getString("cs.optAll"), LangTool.getString("cs.optCancel")}; int result = JOptionPane.showOptionDialog( this.getParent(), // the parent that the dialog blocks message, // the dialog message array LangTool.getString("cs.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); if (result == 0) { closeMe(); } if (result == 1) { me.closingDown((Session)this); } }
| 6,590
|
private void closeSession() { vt.isOnSignoffScreen(); Object[] message = new Object[1]; message[0] = LangTool.getString("cs.message"); String[] options = {LangTool.getString("cs.optThis"), LangTool.getString("cs.optAll"), LangTool.getString("cs.optCancel")}; int result = JOptionPane.showOptionDialog( this.getParent(), // the parent that the dialog blocks message, // the dialog message array LangTool.getString("cs.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); if (result == 0) { closeMe(); } if (result == 1) { me.closingDown((Session)this); } }
|
private void closeSession() { vt.isOnSignoffScreen(); Object[] message = new Object[1]; message[0] = LangTool.getString("cs.message"); String[] options = {LangTool.getString("cs.optThis"), LangTool.getString("cs.optAll"), LangTool.getString("cs.optCancel")}; int result = JOptionPane.showOptionDialog( this.getParent(), // the parent that the dialog blocks message, // the dialog message array LangTool.getString("cs.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); if (result == 0) { if (!isOnSignoffScreen()) { if (confirmClose()) { closeMe(); } } else { closeMe(); } } if (result == 1) { me.closingDown((Session)this); } }
| 6,591
|
private void doAttributes() { Frame parent = null; // if me is null then we must be called from an applet so we create // a new frame object. if (me == null) parent = new JFrame(); else parent = (Frame)me.getParentView((Session)this); SessionAttributes sa = new SessionAttributes(parent,sesConfig); Vector listeners = sesConfig.getSessionConfigListeners(); Enumeration e = listeners.elements(); while (e.hasMoreElements()) { sa.addPropertyChangeListener((Session)e.nextElement()); } sa.showIt(); listeners = sesConfig.getSessionConfigListeners(); e = listeners.elements(); while (e.hasMoreElements()) { sa.removePropertyChangeListener((Session)e.nextElement()); } getFocusForMe(); sa = null; }
|
private void doAttributes() { Frame parent = null; // if me is null then we must be called from an applet so we create // a new frame object. if (me == null) parent = new JFrame(); else parent = (Frame)me.getParentView((Session)this); SessionAttributes sa = new SessionAttributes(parent,sesConfig); Vector listeners = sesConfig.getSessionConfigListeners(); Enumeration e = listeners.elements(); while (e.hasMoreElements()) { sa.addPropertyChangeListener((Session)e.nextElement()); } sa.showIt(); listeners = sesConfig.getSessionConfigListeners(); e = listeners.elements(); while (e.hasMoreElements()) { sa.removePropertyChangeListener((Session)e.nextElement()); } getFocusForMe(); sa = null; }
| 6,592
|
private void doAttributes() { Frame parent = null; // if me is null then we must be called from an applet so we create // a new frame object. if (me == null) parent = new JFrame(); else parent = (Frame)me.getParentView((Session)this); SessionAttributes sa = new SessionAttributes(parent,sesConfig); Vector listeners = sesConfig.getSessionConfigListeners(); Enumeration e = listeners.elements(); while (e.hasMoreElements()) { sa.addPropertyChangeListener((Session)e.nextElement()); } sa.showIt(); listeners = sesConfig.getSessionConfigListeners(); e = listeners.elements(); while (e.hasMoreElements()) { sa.removePropertyChangeListener((Session)e.nextElement()); } getFocusForMe(); sa = null; }
|
private void doAttributes() { Frame parent = null; // if me is null then we must be called from an applet so we create // a new frame object. if (me == null) parent = new JFrame(); else parent = (Frame)me.getParentView((Session)this); SessionAttributes sa = new SessionAttributes(parent,sesConfig); Vector listeners = sesConfig.getSessionConfigListeners(); Enumeration e = listeners.elements(); while (e.hasMoreElements()) { sa.addPropertyChangeListener((Session)e.nextElement()); } sa.showIt(); listeners = sesConfig.getSessionConfigListeners(); e = listeners.elements(); while (e.hasMoreElements()) { sa.removePropertyChangeListener((Session)e.nextElement()); } getFocusForMe(); sa = null; }
| 6,593
|
public void onConfigChanged(SessionConfigEvent changeEvent) { }
|
public void onConfigChanged(SessionConfigEvent pce) { }
| 6,595
|
public static float[] RGBtoHSB(int red, int green, int blue, float array[]) { if (array == null) array = new float[3]; // Calculate brightness. int min; int max; if (red < green) { min = red; max = green; } else { min = green; max = red; } if (blue > max) max = blue; else if (blue < min) min = blue; array[2] = max / 255f; // Calculate saturation. if (max == 0) array[1] = 0; else array[1] = (max - min) / max; // Calculate hue. if (array[1] == 0) array[0] = 0; else { float delta = (max - min) * 6; if (red == max) array[0] = (green - blue) / delta; else if (green == max) array[0] = 1 / 3 + (blue - red) / delta; else array[0] = 2 / 3 + (red - green) / delta; if (array[0] < 0) array[0]++; } return array; }
|
public static float[] RGBtoHSB(int red, int green, int blue, float array[]) { if (array == null) array = new float[3]; // Calculate brightness. int min; int max; if (red < green) { min = red; max = green; } else { min = green; max = red; } if (blue > max) max = blue; else if (blue < min) min = blue; array[2] = max / 255f; // Calculate saturation. if (max == 0) array[1] = 0; else array[1] = (max - min) / max; // Calculate hue. if (array[1] == 0) array[0] = 0; else { float delta = (max - min) * 6; if (red == max) array[0] = (green - blue) / delta; else if (green == max) array[0] = 1f / 3 + (blue - red) / delta; else array[0] = 2 / 3 + (red - green) / delta; if (array[0] < 0) array[0]++; } return array; }
| 6,597
|
public static float[] RGBtoHSB(int red, int green, int blue, float array[]) { if (array == null) array = new float[3]; // Calculate brightness. int min; int max; if (red < green) { min = red; max = green; } else { min = green; max = red; } if (blue > max) max = blue; else if (blue < min) min = blue; array[2] = max / 255f; // Calculate saturation. if (max == 0) array[1] = 0; else array[1] = (max - min) / max; // Calculate hue. if (array[1] == 0) array[0] = 0; else { float delta = (max - min) * 6; if (red == max) array[0] = (green - blue) / delta; else if (green == max) array[0] = 1 / 3 + (blue - red) / delta; else array[0] = 2 / 3 + (red - green) / delta; if (array[0] < 0) array[0]++; } return array; }
|
public static float[] RGBtoHSB(int red, int green, int blue, float array[]) { if (array == null) array = new float[3]; // Calculate brightness. int min; int max; if (red < green) { min = red; max = green; } else { min = green; max = red; } if (blue > max) max = blue; else if (blue < min) min = blue; array[2] = max / 255f; // Calculate saturation. if (max == 0) array[1] = 0; else array[1] = (max - min) / max; // Calculate hue. if (array[1] == 0) array[0] = 0; else { float delta = (max - min) * 6; if (red == max) array[0] = (green - blue) / delta; else if (green == max) array[0] = 1 / 3 + (blue - red) / delta; else array[0] = 2f / 3 + (red - green) / delta; if (array[0] < 0) array[0]++; } return array; }
| 6,598
|
public void closeFrame(JInternalFrame frame) { Container c = frame.getParent(); frame.doDefaultCloseAction(); if (c != null) { if (frame.isIcon()) c.remove(frame.getDesktopIcon()); else c.remove(frame); c.repaint(); } }
|
public void closeFrame(JInternalFrame frame) { Container c = frame.getParent(); if (c != null) { if (frame.isIcon()) c.remove(frame.getDesktopIcon()); else c.remove(frame); c.repaint(); } }
| 6,599
|
public void endDraggingFrame(JComponent component) { if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE) { setBoundsForFrame((JInternalFrame) component, dragCache.x, dragCache.y, dragCache.width, dragCache.height); pane = null; dragCache = null; } component.repaint(); }
|
public void endDraggingFrame(JComponent component) { if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE) { setBoundsForFrame((JInternalFrame) component, dragCache.x, dragCache.y, dragCache.width, dragCache.height); pane = null; dragCache = null; component.repaint();
| 6,600
|
public void endResizingFrame(JComponent component) { if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE) { setBoundsForFrame((JInternalFrame) component, dragCache.x, dragCache.y, dragCache.width, dragCache.height); pane = null; dragCache = null; } component.repaint(); }
|
public void endResizingFrame(JComponent component) { if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE) { setBoundsForFrame((JInternalFrame) component, dragCache.x, dragCache.y, dragCache.width, dragCache.height); pane = null; dragCache = null; component.repaint();
| 6,602
|
public void setBoundsForFrame(JComponent component, int newX, int newY, int newWidth, int newHeight) { component.setBounds(newX, newY, newWidth, newHeight); component.revalidate(); // If not null, I'd rather repaint the parent if (component.getParent() != null) component.getParent().repaint(); else component.repaint(); }
|
public void setBoundsForFrame(JComponent component, int newX, int newY, int newWidth, int newHeight) { component.setBounds(newX, newY, newWidth, newHeight); component.revalidate(); // If not null, I'd rather repaint the parent if (component.getParent() != null) component.getParent().repaint(); else component.repaint(); }
| 6,604
|
public static Binding extract(Any a) { try { return ((BindingHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION("Binding expected"); } }
|
public static Binding extract(Any a) { try { return ((BindingHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION("Binding expected"); bad.minor = Minor.Any; bad.initCause(ex); throw bad; } }
| 6,605
|
public final void restoreScreen() throws IOException { int which = 0; try {// System.out.println("Restore "); bk.getNextByte(); bk.getNextByte(); int rows = bk.getNextByte() & 0xff; int cols = bk.getNextByte() & 0xff; int pos = bk.getNextByte() << 8 & 0xff00; pos |= bk.getNextByte() & 0xff; int hPos = bk.getNextByte() << 8 & 0xff00; hPos |= bk.getNextByte() & 0xff; if (rows != screen52.getRows()) screen52.setRowsCols(rows,cols); screen52.clearAll(); // initialize what we currenty have int b = 32; int la = 32; int len = rows * cols; for (int y = 0;y < len; y++) { b = bk.getNextByte(); if (isAttribute(b)) { screen52.screen[y].setCharAndAttr( screen52.screen[y].getChar(), b, true); la = b; } else { screen52.screen[y].setCharAndAttr( getASCIIChar(b), la, false); } } int numFields = bk.getNextByte() << 8 & 0xff00; numFields |= bk.getNextByte() & 0xff;// System.out.println("number of fields " + numFields); if (numFields > 0) { int x = 0; int attr = 0; int fPos = 0; int fLen = 0; int ffw1 = 0; int ffw2 = 0; int fcw1 = 0; int fcw2 = 0; boolean mdt = false; ScreenField sf = null; while (x < numFields) { attr = bk.getNextByte(); fPos = bk.getNextByte() << 8 & 0xff00; fPos |= bk.getNextByte() & 0xff; if (bk.getNextByte() == 1) mdt = true; else mdt = false; fLen = bk.getNextByte() << 8 & 0xff00; fLen |= bk.getNextByte() & 0xff; ffw1 = bk.getNextByte(); ffw2 = bk.getNextByte(); fcw1 = bk.getNextByte(); fcw2 = bk.getNextByte(); sf = screen52.getScreenFields().setField(attr, screen52.getRow(fPos), screen52.getCol(fPos), fLen, ffw1, ffw2, fcw1, fcw2); if (mdt) sf.setMDT();// System.out.println("/nRestored ");// System.out.println(sf.toString());// x++; } } screen52.restoreScreen(); // display the screen screen52.homePos = hPos; screen52.goto_XY(pos); screen52.isInField(); if (screen52.isUsingGuiInterface()) screen52.drawFields(); } catch (Exception e) { System.out.println("error restoring screen " + which + " with " + e.getMessage()); } }
|
public final void restoreScreen() throws IOException { int which = 0; try {// System.out.println("Restore "); bk.getNextByte(); bk.getNextByte(); int rows = bk.getNextByte() & 0xff; int cols = bk.getNextByte() & 0xff; int pos = bk.getNextByte() << 8 & 0xff00; pos |= bk.getNextByte() & 0xff; int hPos = bk.getNextByte() << 8 & 0xff00; hPos |= bk.getNextByte() & 0xff; if (rows != screen52.getRows()) screen52.setRowsCols(rows,cols); screen52.clearAll(); // initialize what we currenty have int b = 32; int la = 32; int len = rows * cols; for (int y = 0;y < len; y++) { b = bk.getNextByte(); if (isAttribute(b)) { screen52.screen[y].setCharAndAttr( screen52.screen[y].getChar(), b, true); la = b; } else { screen52.screen[y].setCharAndAttr( getASCIIChar(b), la, false); } } int numFields = bk.getNextByte() << 8 & 0xff00; numFields |= bk.getNextByte() & 0xff;// System.out.println("number of fields " + numFields); if (numFields > 0) { int x = 0; int attr = 0; int fPos = 0; int fLen = 0; int ffw1 = 0; int ffw2 = 0; int fcw1 = 0; int fcw2 = 0; boolean mdt = false; ScreenField sf = null; while (x < numFields) { attr = bk.getNextByte(); fPos = bk.getNextByte() << 8 & 0xff00; fPos |= bk.getNextByte() & 0xff; if (bk.getNextByte() == 1) mdt = true; else mdt = false; fLen = bk.getNextByte() << 8 & 0xff00; fLen |= bk.getNextByte() & 0xff; ffw1 = bk.getNextByte(); ffw2 = bk.getNextByte(); fcw1 = bk.getNextByte(); fcw2 = bk.getNextByte(); sf = screen52.getScreenFields().setField(attr, screen52.getRow(fPos), screen52.getCol(fPos), fLen, ffw1, ffw2, fcw1, fcw2); if (mdt) sf.setMDT();// System.out.println("/nRestored ");// System.out.println(sf.toString());// x++; } } screen52.restoreScreen(); // display the screen screen52.setPendingInsert(true,screen52.getRow(pos), screen52.getCol(pos)); screen52.goto_XY(pos); screen52.isInField(); if (screen52.isUsingGuiInterface()) screen52.drawFields(); } catch (Exception e) { System.out.println("error restoring screen " + which + " with " + e.getMessage()); } }
| 6,606
|
void layoutAlgorithm(Container parent, Direction layoutDir, Direction crossDir) { if (parent != container) throw new AWTError("invalid parent"); Dimension parentSize = parent.getSize(); Insets insets = parent.getInsets(); Dimension innerSize = new Dimension(parentSize.width - insets.left - insets.right, parentSize.height - insets.bottom - insets.top); // Set all components to their preferredSizes and sum up the allocated // space. Create SizeReqs for each component and store them in // sizeReqs. Find the maximum size in the crossing direction. Component[] children = AWTUtilities.getVisibleChildren(parent); Vector sizeReqs = new Vector(); int allocated = 0; for (int i = 0; i < children.length; i++) { Component c = children[i]; SizeReq sizeReq = new SizeReq(c, layoutDir); int preferred = layoutDir.size(c.getPreferredSize()); sizeReq.size = preferred; allocated += preferred; sizeReqs.add(sizeReq); } // Distribute remaining space (may be positive or negative) over components int remainder = layoutDir.size(innerSize) - allocated; distributeSpace(sizeReqs, remainder, layoutDir); // Resize and relocate components. If the component can be sized to // take the full space in the crossing direction, then do so, otherwise // align according to its alingnmentX or alignmentY property. int loc = 0; int offset1 = layoutDir.lower(insets); int offset2 = crossDir.lower(insets); for (Iterator i = sizeReqs.iterator(); i.hasNext();) { SizeReq sizeReq = (SizeReq) i.next(); Component c = sizeReq.comp; int availCrossSize = crossDir.size(innerSize); int maxCross = crossDir.size(c.getMaximumSize()); int crossSize = Math.min(availCrossSize, maxCross); int crossRemainder = availCrossSize - crossSize; int crossLoc = (int) (crossDir.alignment(c) * crossRemainder); layoutDir.setSize(c, sizeReq.size, crossSize); layoutDir.setLocation(c, offset1 + loc, offset2 + crossLoc); loc += sizeReq.size; } }
|
void layoutAlgorithm(Container parent, Direction layoutDir, Direction crossDir) { if (parent != container) throw new AWTError("invalid parent"); Dimension parentSize = parent.getSize(); Insets insets = parent.getInsets(); Dimension innerSize = new Dimension(parentSize.width - insets.left - insets.right, parentSize.height - insets.bottom - insets.top); // Set all components to their preferredSizes and sum up the allocated // space. Create SizeReqs for each component and store them in // sizeReqs. Find the maximum size in the crossing direction. List children = AWTUtilities.getVisibleChildren(parent); Vector sizeReqs = new Vector(); int allocated = 0; for (int i = 0; i < children.length; i++) { Component c = children[i]; SizeReq sizeReq = new SizeReq(c, layoutDir); int preferred = layoutDir.size(c.getPreferredSize()); sizeReq.size = preferred; allocated += preferred; sizeReqs.add(sizeReq); } // Distribute remaining space (may be positive or negative) over components int remainder = layoutDir.size(innerSize) - allocated; distributeSpace(sizeReqs, remainder, layoutDir); // Resize and relocate components. If the component can be sized to // take the full space in the crossing direction, then do so, otherwise // align according to its alingnmentX or alignmentY property. int loc = 0; int offset1 = layoutDir.lower(insets); int offset2 = crossDir.lower(insets); for (Iterator i = sizeReqs.iterator(); i.hasNext();) { SizeReq sizeReq = (SizeReq) i.next(); Component c = sizeReq.comp; int availCrossSize = crossDir.size(innerSize); int maxCross = crossDir.size(c.getMaximumSize()); int crossSize = Math.min(availCrossSize, maxCross); int crossRemainder = availCrossSize - crossSize; int crossLoc = (int) (crossDir.alignment(c) * crossRemainder); layoutDir.setSize(c, sizeReq.size, crossSize); layoutDir.setLocation(c, offset1 + loc, offset2 + crossLoc); loc += sizeReq.size; } }
| 6,607
|
void layoutAlgorithm(Container parent, Direction layoutDir, Direction crossDir) { if (parent != container) throw new AWTError("invalid parent"); Dimension parentSize = parent.getSize(); Insets insets = parent.getInsets(); Dimension innerSize = new Dimension(parentSize.width - insets.left - insets.right, parentSize.height - insets.bottom - insets.top); // Set all components to their preferredSizes and sum up the allocated // space. Create SizeReqs for each component and store them in // sizeReqs. Find the maximum size in the crossing direction. Component[] children = AWTUtilities.getVisibleChildren(parent); Vector sizeReqs = new Vector(); int allocated = 0; for (int i = 0; i < children.length; i++) { Component c = children[i]; SizeReq sizeReq = new SizeReq(c, layoutDir); int preferred = layoutDir.size(c.getPreferredSize()); sizeReq.size = preferred; allocated += preferred; sizeReqs.add(sizeReq); } // Distribute remaining space (may be positive or negative) over components int remainder = layoutDir.size(innerSize) - allocated; distributeSpace(sizeReqs, remainder, layoutDir); // Resize and relocate components. If the component can be sized to // take the full space in the crossing direction, then do so, otherwise // align according to its alingnmentX or alignmentY property. int loc = 0; int offset1 = layoutDir.lower(insets); int offset2 = crossDir.lower(insets); for (Iterator i = sizeReqs.iterator(); i.hasNext();) { SizeReq sizeReq = (SizeReq) i.next(); Component c = sizeReq.comp; int availCrossSize = crossDir.size(innerSize); int maxCross = crossDir.size(c.getMaximumSize()); int crossSize = Math.min(availCrossSize, maxCross); int crossRemainder = availCrossSize - crossSize; int crossLoc = (int) (crossDir.alignment(c) * crossRemainder); layoutDir.setSize(c, sizeReq.size, crossSize); layoutDir.setLocation(c, offset1 + loc, offset2 + crossLoc); loc += sizeReq.size; } }
|
void layoutAlgorithm(Container parent, Direction layoutDir, Direction crossDir) { if (parent != container) throw new AWTError("invalid parent"); Dimension parentSize = parent.getSize(); Insets insets = parent.getInsets(); Dimension innerSize = new Dimension(parentSize.width - insets.left - insets.right, parentSize.height - insets.bottom - insets.top); // Set all components to their preferredSizes and sum up the allocated // space. Create SizeReqs for each component and store them in // sizeReqs. Find the maximum size in the crossing direction. Component[] children = AWTUtilities.getVisibleChildren(parent); Vector sizeReqs = new Vector(); int allocated = 0; for (Iterator i = children.iterator(); i.hasNext();) { Component c = children[i]; SizeReq sizeReq = new SizeReq(c, layoutDir); int preferred = layoutDir.size(c.getPreferredSize()); sizeReq.size = preferred; allocated += preferred; sizeReqs.add(sizeReq); } // Distribute remaining space (may be positive or negative) over components int remainder = layoutDir.size(innerSize) - allocated; distributeSpace(sizeReqs, remainder, layoutDir); // Resize and relocate components. If the component can be sized to // take the full space in the crossing direction, then do so, otherwise // align according to its alingnmentX or alignmentY property. int loc = 0; int offset1 = layoutDir.lower(insets); int offset2 = crossDir.lower(insets); for (Iterator i = sizeReqs.iterator(); i.hasNext();) { SizeReq sizeReq = (SizeReq) i.next(); Component c = sizeReq.comp; int availCrossSize = crossDir.size(innerSize); int maxCross = crossDir.size(c.getMaximumSize()); int crossSize = Math.min(availCrossSize, maxCross); int crossRemainder = availCrossSize - crossSize; int crossLoc = (int) (crossDir.alignment(c) * crossRemainder); layoutDir.setSize(c, sizeReq.size, crossSize); layoutDir.setLocation(c, offset1 + loc, offset2 + crossLoc); loc += sizeReq.size; } }
| 6,608
|
void layoutAlgorithm(Container parent, Direction layoutDir, Direction crossDir) { if (parent != container) throw new AWTError("invalid parent"); Dimension parentSize = parent.getSize(); Insets insets = parent.getInsets(); Dimension innerSize = new Dimension(parentSize.width - insets.left - insets.right, parentSize.height - insets.bottom - insets.top); // Set all components to their preferredSizes and sum up the allocated // space. Create SizeReqs for each component and store them in // sizeReqs. Find the maximum size in the crossing direction. Component[] children = AWTUtilities.getVisibleChildren(parent); Vector sizeReqs = new Vector(); int allocated = 0; for (int i = 0; i < children.length; i++) { Component c = children[i]; SizeReq sizeReq = new SizeReq(c, layoutDir); int preferred = layoutDir.size(c.getPreferredSize()); sizeReq.size = preferred; allocated += preferred; sizeReqs.add(sizeReq); } // Distribute remaining space (may be positive or negative) over components int remainder = layoutDir.size(innerSize) - allocated; distributeSpace(sizeReqs, remainder, layoutDir); // Resize and relocate components. If the component can be sized to // take the full space in the crossing direction, then do so, otherwise // align according to its alingnmentX or alignmentY property. int loc = 0; int offset1 = layoutDir.lower(insets); int offset2 = crossDir.lower(insets); for (Iterator i = sizeReqs.iterator(); i.hasNext();) { SizeReq sizeReq = (SizeReq) i.next(); Component c = sizeReq.comp; int availCrossSize = crossDir.size(innerSize); int maxCross = crossDir.size(c.getMaximumSize()); int crossSize = Math.min(availCrossSize, maxCross); int crossRemainder = availCrossSize - crossSize; int crossLoc = (int) (crossDir.alignment(c) * crossRemainder); layoutDir.setSize(c, sizeReq.size, crossSize); layoutDir.setLocation(c, offset1 + loc, offset2 + crossLoc); loc += sizeReq.size; } }
|
void layoutAlgorithm(Container parent, Direction layoutDir, Direction crossDir) { if (parent != container) throw new AWTError("invalid parent"); Dimension parentSize = parent.getSize(); Insets insets = parent.getInsets(); Dimension innerSize = new Dimension(parentSize.width - insets.left - insets.right, parentSize.height - insets.bottom - insets.top); // Set all components to their preferredSizes and sum up the allocated // space. Create SizeReqs for each component and store them in // sizeReqs. Find the maximum size in the crossing direction. Component[] children = AWTUtilities.getVisibleChildren(parent); Vector sizeReqs = new Vector(); int allocated = 0; for (int i = 0; i < children.length; i++) { Component c = (Component) i.next(); SizeReq sizeReq = new SizeReq(c, layoutDir); int preferred = layoutDir.size(c.getPreferredSize()); sizeReq.size = preferred; allocated += preferred; sizeReqs.add(sizeReq); } // Distribute remaining space (may be positive or negative) over components int remainder = layoutDir.size(innerSize) - allocated; distributeSpace(sizeReqs, remainder, layoutDir); // Resize and relocate components. If the component can be sized to // take the full space in the crossing direction, then do so, otherwise // align according to its alingnmentX or alignmentY property. int loc = 0; int offset1 = layoutDir.lower(insets); int offset2 = crossDir.lower(insets); for (Iterator i = sizeReqs.iterator(); i.hasNext();) { SizeReq sizeReq = (SizeReq) i.next(); Component c = sizeReq.comp; int availCrossSize = crossDir.size(innerSize); int maxCross = crossDir.size(c.getMaximumSize()); int crossSize = Math.min(availCrossSize, maxCross); int crossRemainder = availCrossSize - crossSize; int crossLoc = (int) (crossDir.alignment(c) * crossRemainder); layoutDir.setSize(c, sizeReq.size, crossSize); layoutDir.setLocation(c, offset1 + loc, offset2 + crossLoc); loc += sizeReq.size; } }
| 6,609
|
public Dimension maximumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.top + insets.bottom; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); x += sz.width; // Check for overflow. if (x < 0) x = Integer.MAX_VALUE; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); y += sz.height; // Check for overflow if (y < 0) y = Integer.MAX_VALUE; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
|
public Dimension maximumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.top + insets.bottom; List children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); x += sz.width; // Check for overflow. if (x < 0) x = Integer.MAX_VALUE; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); y += sz.height; // Check for overflow if (y < 0) y = Integer.MAX_VALUE; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
| 6,610
|
public Dimension maximumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.top + insets.bottom; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); x += sz.width; // Check for overflow. if (x < 0) x = Integer.MAX_VALUE; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); y += sz.height; // Check for overflow if (y < 0) y = Integer.MAX_VALUE; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
|
public Dimension maximumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.top + insets.bottom; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (Iterator i = children.iterator(); i.hasNext();) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); x += sz.width; // Check for overflow. if (x < 0) x = Integer.MAX_VALUE; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (Iterator i = children.iterator(); i.hasNext();) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); y += sz.height; // Check for overflow if (y < 0) y = Integer.MAX_VALUE; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
| 6,611
|
public Dimension maximumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.top + insets.bottom; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); x += sz.width; // Check for overflow. if (x < 0) x = Integer.MAX_VALUE; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); y += sz.height; // Check for overflow if (y < 0) y = Integer.MAX_VALUE; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
|
public Dimension maximumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.top + insets.bottom; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = (Component) i.next(); Dimension sz = comp.getMaximumSize(); x += sz.width; // Check for overflow. if (x < 0) x = Integer.MAX_VALUE; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = (Component) i.next(); Dimension sz = comp.getMaximumSize(); y += sz.height; // Check for overflow if (y < 0) y = Integer.MAX_VALUE; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
| 6,612
|
public Dimension minimumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.bottom + insets.top; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); x += sz.width; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); y += sz.height; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
|
public Dimension minimumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.bottom + insets.top; List children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); x += sz.width; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); y += sz.height; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
| 6,613
|
public Dimension minimumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.bottom + insets.top; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); x += sz.width; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); y += sz.height; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
|
public Dimension minimumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.bottom + insets.top; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (Iterator i = children.iterator(); i.hasNext();) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); x += sz.width; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (Iterator i = children.iterator(); i.hasNext();) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); y += sz.height; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
| 6,614
|
public Dimension minimumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.bottom + insets.top; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); x += sz.width; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); y += sz.height; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
|
public Dimension minimumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.bottom + insets.top; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = (Component) i.next(); Dimension sz = comp.getMinimumSize(); x += sz.width; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = (Component) i.next(); Dimension sz = comp.getMinimumSize(); y += sz.height; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
| 6,615
|
public Dimension preferredLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = 0; int y = 0; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { x = insets.left + insets.right; // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); x += sz.width; y = Math.max(y, sz.height); } y += insets.bottom + insets.top; } else { y = insets.top + insets.bottom; // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); y += sz.height; x = Math.max(x, sz.width); } x += insets.left + insets.right; } return new Dimension(x, y); }
|
public Dimension preferredLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = 0; int y = 0; List children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { x = insets.left + insets.right; // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); x += sz.width; y = Math.max(y, sz.height); } y += insets.bottom + insets.top; } else { y = insets.top + insets.bottom; // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); y += sz.height; x = Math.max(x, sz.width); } x += insets.left + insets.right; } return new Dimension(x, y); }
| 6,616
|
public Dimension preferredLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = 0; int y = 0; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { x = insets.left + insets.right; // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); x += sz.width; y = Math.max(y, sz.height); } y += insets.bottom + insets.top; } else { y = insets.top + insets.bottom; // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); y += sz.height; x = Math.max(x, sz.width); } x += insets.left + insets.right; } return new Dimension(x, y); }
|
public Dimension preferredLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = 0; int y = 0; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { x = insets.left + insets.right; // sum up preferred widths of components, find maximum of preferred // heights for (Iterator i = children.iterator(); i.hasNext();) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); x += sz.width; y = Math.max(y, sz.height); } y += insets.bottom + insets.top; } else { y = insets.top + insets.bottom; // sum up preferred heights of components, find maximum of // preferred widths for (Iterator i = children.iterator(); i.hasNext();) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); y += sz.height; x = Math.max(x, sz.width); } x += insets.left + insets.right; } return new Dimension(x, y); }
| 6,617
|
public Dimension preferredLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = 0; int y = 0; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { x = insets.left + insets.right; // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); x += sz.width; y = Math.max(y, sz.height); } y += insets.bottom + insets.top; } else { y = insets.top + insets.bottom; // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); y += sz.height; x = Math.max(x, sz.width); } x += insets.left + insets.right; } return new Dimension(x, y); }
|
public Dimension preferredLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Insets insets = parent.getInsets(); int x = 0; int y = 0; Component[] children = AWTUtilities.getVisibleChildren(parent); if (isHorizontalIn(parent)) { x = insets.left + insets.right; // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = (Component) i.next(); Dimension sz = comp.getPreferredSize(); x += sz.width; y = Math.max(y, sz.height); } y += insets.bottom + insets.top; } else { y = insets.top + insets.bottom; // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = (Component) i.next(); Dimension sz = comp.getPreferredSize(); y += sz.height; x = Math.max(x, sz.width); } x += insets.left + insets.right; } return new Dimension(x, y); }
| 6,618
|
public void run () {// Toolkit tk = Toolkit.getDefaultToolkit();//int [][] range = new int[][] {//new int[] { 1, 1 }//};// JobAttributes jobAttributes = new JobAttributes(1, JobAttributes.DefaultSelectionType.ALL, JobAttributes.DestinationType.PRINTER, JobAttributes.DialogType.NONE, "file", 1, 1, JobAttributes.MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES, range, "HP LaserJet", JobAttributes.SidesType.ONE_SIDED);//PrintJob job = tk.getPrintJob(null, "Print", jobAttributes, null);//if (job != null) { //--- Create a printerJob object PrinterJob printJob = PrinterJob.getPrinterJob (); printJob.setJobName("tn5250j"); //--- Set the printable class to this one since we //--- are implementing the Printable interface printJob.setPrintable (this); // set the cursor back session.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); //--- Show a print dialog to the user. If the user //--- clicks the print button, then print, otherwise //--- cancel the print job if (printJob.printDialog()) { try { // we do this because of loosing focus with jdk 1.4.0 session.requestFocus(); printJob.print(); } catch (Exception PrintException) { PrintException.printStackTrace(); } } else { // we do this because of loosing focus with jdk 1.4.0 session.requestFocus(); } session = null; int len = screen.length; for (int x = 0; x < len; x++) { screen[x] = null; } screen = null; }
|
public void run () {// Toolkit tk = Toolkit.getDefaultToolkit();//int [][] range = new int[][] {//new int[] { 1, 1 }//};// JobAttributes jobAttributes = new JobAttributes(1, JobAttributes.DefaultSelectionType.ALL, JobAttributes.DestinationType.PRINTER, JobAttributes.DialogType.NONE, "file", 1, 1, JobAttributes.MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES, range, "HP LaserJet", JobAttributes.SidesType.ONE_SIDED);//PrintJob job = tk.getPrintJob(null, "Print", jobAttributes, null);//if (job != null) { //--- Create a printerJob object PrinterJob printJob = PrinterJob.getPrinterJob (); printJob.setJobName("tn5250j"); //--- Set the printable class to this one since we //--- are implementing the Printable interface printJob.setPrintable (this,pf); // set the cursor back session.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); //--- Show a print dialog to the user. If the user //--- clicks the print button, then print, otherwise //--- cancel the print job if (printJob.printDialog()) { try { // we do this because of loosing focus with jdk 1.4.0 session.requestFocus(); printJob.print(); } catch (Exception PrintException) { PrintException.printStackTrace(); } } else { // we do this because of loosing focus with jdk 1.4.0 session.requestFocus(); } session = null; int len = screen.length; for (int x = 0; x < len; x++) { screen[x] = null; } screen = null; }
| 6,621
|
protected ChangeListener createChangeListener() { return new ChangeListener() { public void stateChanged(ChangeEvent e) { AbstractButton.this.fireStateChanged(); AbstractButton.this.repaint(); } }; }
|
protected ChangeListener createChangeListener() { return new ChangeListener() { public void stateChanged(ChangeEvent e) { AbstractButton.this.fireStateChanged(); AbstractButton.this.repaint(); } }; }
| 6,623
|
public void layoutContainer(Container parent) { // Sun's implementation simply throws a ClassCastException if // parent is no JScrollPane, so do we. JScrollPane sc = (JScrollPane) parent; JViewport viewport = sc.getViewport(); Component view = viewport.getView(); // If there is no view in the viewport, there is no work to be done. if (view == null) return; Dimension viewSize = viewport.getView().getPreferredSize(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); int vsWidth = 0; int hsHeight = 0; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y4 - y2))); if (showVsb) vsWidth = vsb.getPreferredSize().width; // The horizontal scroll bar may become necessary if the vertical scroll // bar appears, reducing the space, left for the component. boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x4 - x2 - vsWidth))); if (showHsb) hsHeight = hsb.getPreferredSize().height; // If the horizontal scroll bar appears, and the vertical scroll bar // was not necessary assuming that there is no horizontal scroll bar, // the vertical scroll bar may become necessary because the horizontal // scroll bar reduces the vertical space for the component. if (!showVsb) { showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y4 - y2))); if (showVsb) vsWidth = vsb.getPreferredSize().width; } x3 = x4 - vsWidth; y3 = y4 - hsHeight; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3 - x2, y3 - y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3 - x2, y2 - y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2 - x1, y3 - y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4 - x3, y3 - y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3 - x2, y4 - y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2 - x1, y2 - y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4 - x3, y2 - y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2 - x1, y4 - y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4 - x3, y4 - y3)); }
|
public void layoutContainer(Container parent) { // Sun's implementation simply throws a ClassCastException if // parent is no JScrollPane, so do we. JScrollPane sc = (JScrollPane) parent; JViewport viewport = sc.getViewport(); Component view = viewport.getView(); // If there is no view in the viewport, there is no work to be done. if (view == null) return; Dimension viewSize = viewport.getView().getPreferredSize(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); int vsWidth = 0; int hsHeight = 0; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y4 - y2))); if (showVsb) vsWidth = vsb.getPreferredSize().width; // The horizontal scroll bar may become necessary if the vertical scroll // bar appears, reducing the space, left for the component. boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x4 - x2 - vsWidth))); if (showHsb) hsHeight = hsb.getPreferredSize().height; // If the horizontal scroll bar appears, and the vertical scroll bar // was not necessary assuming that there is no horizontal scroll bar, // the vertical scroll bar may become necessary because the horizontal // scroll bar reduces the vertical space for the component. if (!showVsb) { showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y4 - y2))); if (showVsb) vsWidth = vsb.getPreferredSize().width; } x3 = x4 - vsWidth; y3 = y4 - hsHeight; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2 + vpi.left, y2 + vpi.top, x3 - x2 - vpi.left - vpi.right, y3 - y2 - vpi.top - vpi.bottom)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3 - x2, y2 - y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2 - x1, y3 - y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4 - x3, y3 - y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3 - x2, y4 - y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2 - x1, y2 - y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4 - x3, y2 - y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2 - x1, y4 - y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4 - x3, y4 - y3)); }
| 6,625
|
private void fireVetoableChange(String name, boolean oldValue, boolean newValue) throws PropertyVetoException { super.fireVetoableChange(name, new Boolean(oldValue), new Boolean(newValue)); }
|
private void fireVetoableChange(String name, boolean oldValue, boolean newValue) throws PropertyVetoException { super.fireVetoableChange(name, Boolean.valueOf(oldValue), Boolean.valueOf(newValue)); }
| 6,628
|
static final void applicationProcessorMain() { final VmX86Processor cpu = (VmX86Processor)Unsafe.getCurrentProcessor(); BootLog.info("Starting Application Processor " + cpu.getId()); // First force a load of CPUID cpu.getCPUID(); // Detect and start logical CPU's try { detectAndstartLogicalProcessors(cpu.rm); } catch (ResourceNotFreeException ex) { BootLog.error("Cannot detect logical processors", ex); } // TODO do something useful. }
|
static final void applicationProcessorMain() throws PragmaLoadStatics { final VmX86Processor cpu = (VmX86Processor)Unsafe.getCurrentProcessor(); BootLog.info("Starting Application Processor " + cpu.getId()); // First force a load of CPUID cpu.getCPUID(); // Detect and start logical CPU's try { detectAndstartLogicalProcessors(cpu.rm); } catch (ResourceNotFreeException ex) { BootLog.error("Cannot detect logical processors", ex); } // TODO do something useful. }
| 6,629
|
private final void setupStructures() { // Clone GDT this.gdt = new GDT(); gdt.setBase(GDT.PROCESSOR_ENTRY, Address.valueOf(this)); // Clone TSS this.tss = new TSS(); gdt.setBase(GDT.TSS_ENTRY, tss.getAddress()); // Create kernel stack tss.setKernelStack(new byte[VmThread.DEFAULT_STACK_SIZE]); // Create user stack final byte[] userStack = new byte[VmThread.DEFAULT_STACK_SIZE]; tss.setUserStack(userStack); this.currentThread = new VmX86Thread(userStack); gdt.dump(System.out); }
|
private final void setupStructures() { // Clone GDT this.gdt = new GDT(); gdt.setBase(GDT.PROCESSOR_ENTRY, Address.valueOf(this)); // Clone TSS this.tss = new TSS(); gdt.setBase(GDT.TSS_ENTRY, tss.getAddress()); // Create kernel stack tss.setKernelStack(new byte[VmThread.DEFAULT_STACK_SIZE]); // Create user stack final byte[] userStack = new byte[VmThread.DEFAULT_STACK_SIZE]; tss.setUserStack(userStack); this.currentThread = new VmX86Thread(userStack); }
| 6,630
|
final void startup(ResourceManager rm) throws ResourceNotFreeException { // Save resource manager, so when this processor starts, it can be // used right away. this.rm = rm; final VmProcessor me = Unsafe.getCurrentProcessor(); BootLog.info("Startup of 0x" + NumberUtils.hex(getId(), 2) + " from " + NumberUtils.hex(me.getId(), 2)); // Setup kernel structures setupStructures(); // Setup the boot code setupBootCode(rm); // Make sure APIC is enabled (the apic of the current CPU!) BootLog.info("Enabling APIC current state " + apic.isEnabled()); apic.setEnabled(true); apic.clearErrors(); //TimeUtils.loop(5000); // Send INIT IPI BootLog.info("Sending INIT IPI"); apic.sendInitIPI(getId(), true); apic.loopUntilNotBusy(); TimeUtils.loop(10); // Send INIT-DeAssert IPI BootLog.info("Sending INIT-DeAssert IPI"); apic.sendInitIPI(getId(), false); apic.loopUntilNotBusy(); TimeUtils.loop(10); final int numStarts = 2; for (int i = 0; i < numStarts; i++) { // Send STARTUP IPI BootLog.info("Sending STARTUP IPI"); apic.clearErrors(); apic.sendStartupIPI(getId(), bootCode.getAddress()); apic.loopUntilNotBusy(); BootLog.info("Not busy"); TimeUtils.loop(100); apic.clearErrors(); } BootLog.info("loop 5000"); TimeUtils.loop(5000); }
|
final void startup(ResourceManager rm) throws ResourceNotFreeException { // Save resource manager, so when this processor starts, it can be // used right away. this.rm = rm; final VmProcessor me = Unsafe.getCurrentProcessor(); BootLog.info("Startup of 0x" + NumberUtils.hex(getId(), 2) + " from " + NumberUtils.hex(me.getId(), 2)); // Setup kernel structures setupStructures(); // Setup the boot code setupBootCode(rm); // Make sure APIC is enabled (the apic of the current CPU!) BootLog.info("Enabling APIC current state " + apic.isEnabled()); apic.setEnabled(true); apic.clearErrors(); //TimeUtils.loop(5000); // Send INIT IPI BootLog.info("Sending INIT IPI"); apic.sendInitIPI(getId(), true); apic.loopUntilNotBusy(); TimeUtils.loop(10); // Send INIT-DeAssert IPI BootLog.info("Sending INIT-DeAssert IPI"); apic.sendInitIPI(getId(), false); apic.loopUntilNotBusy(); TimeUtils.loop(10); final int numStarts = 2; for (int i = 0; i < numStarts; i++) { // Send STARTUP IPI BootLog.info("Sending STARTUP IPI"); apic.clearErrors(); apic.sendStartupIPI(getId(), bootCode.getAddress()); apic.loopUntilNotBusy(); TimeUtils.loop(100); apic.clearErrors(); } BootLog.info("loop 5000"); TimeUtils.loop(5000); }
| 6,631
|
final void startup(ResourceManager rm) throws ResourceNotFreeException { // Save resource manager, so when this processor starts, it can be // used right away. this.rm = rm; final VmProcessor me = Unsafe.getCurrentProcessor(); BootLog.info("Startup of 0x" + NumberUtils.hex(getId(), 2) + " from " + NumberUtils.hex(me.getId(), 2)); // Setup kernel structures setupStructures(); // Setup the boot code setupBootCode(rm); // Make sure APIC is enabled (the apic of the current CPU!) BootLog.info("Enabling APIC current state " + apic.isEnabled()); apic.setEnabled(true); apic.clearErrors(); //TimeUtils.loop(5000); // Send INIT IPI BootLog.info("Sending INIT IPI"); apic.sendInitIPI(getId(), true); apic.loopUntilNotBusy(); TimeUtils.loop(10); // Send INIT-DeAssert IPI BootLog.info("Sending INIT-DeAssert IPI"); apic.sendInitIPI(getId(), false); apic.loopUntilNotBusy(); TimeUtils.loop(10); final int numStarts = 2; for (int i = 0; i < numStarts; i++) { // Send STARTUP IPI BootLog.info("Sending STARTUP IPI"); apic.clearErrors(); apic.sendStartupIPI(getId(), bootCode.getAddress()); apic.loopUntilNotBusy(); BootLog.info("Not busy"); TimeUtils.loop(100); apic.clearErrors(); } BootLog.info("loop 5000"); TimeUtils.loop(5000); }
|
final void startup(ResourceManager rm) throws ResourceNotFreeException { // Save resource manager, so when this processor starts, it can be // used right away. this.rm = rm; final VmProcessor me = Unsafe.getCurrentProcessor(); BootLog.info("Startup of 0x" + NumberUtils.hex(getId(), 2) + " from " + NumberUtils.hex(me.getId(), 2)); // Setup kernel structures setupStructures(); // Setup the boot code setupBootCode(rm); // Make sure APIC is enabled (the apic of the current CPU!) BootLog.info("Enabling APIC current state " + apic.isEnabled()); apic.setEnabled(true); apic.clearErrors(); //TimeUtils.loop(5000); // Send INIT IPI BootLog.info("Sending INIT IPI"); apic.sendInitIPI(getId(), true); apic.loopUntilNotBusy(); TimeUtils.loop(10); // Send INIT-DeAssert IPI BootLog.info("Sending INIT-DeAssert IPI"); apic.sendInitIPI(getId(), false); apic.loopUntilNotBusy(); TimeUtils.loop(10); final int numStarts = 2; for (int i = 0; i < numStarts; i++) { // Send STARTUP IPI BootLog.info("Sending STARTUP IPI"); apic.clearErrors(); apic.sendStartupIPI(getId(), bootCode.getAddress()); apic.loopUntilNotBusy(); BootLog.info("Not busy"); TimeUtils.loop(100); apic.clearErrors(); } BootLog.info("loop 5000"); TimeUtils.loop(5000); }
| 6,632
|
addLayoutComponent(Component component, Object constraints){ if (constraints != null && ! (constraints instanceof String)) throw new IllegalArgumentException("Constraint must be a string"); String str = (String)constraints; if (str == null || str.equals(CENTER)) center = component; else if (str.equals(NORTH)) north = component; else if (str.equals(SOUTH)) south = component; else if (str.equals(EAST)) east = component; else if (str.equals(WEST)) west = component; else if (str.equals(BEFORE_FIRST_LINE)) firstLine = component; else if (str.equals(AFTER_LAST_LINE)) lastLine = component; else if (str.equals(BEFORE_LINE_BEGINS)) firstItem = component; else if (str.equals(AFTER_LINE_ENDS)) lastItem = component; else throw new IllegalArgumentException("Constraint value not valid: " + str);}
|
addLayoutComponent(Component component, Object constraints){ if (constraints != null && ! (constraints instanceof String)) throw new IllegalArgumentException("Constraint must be a string"); String str = (String)constraints; if (str == null || str.equals(CENTER)) center = component; else if (str.equals(NORTH)) north = component; else if (str.equals(SOUTH)) south = component; else if (str.equals(EAST)) east = component; else if (str.equals(WEST)) west = component; else if (str.equals(BEFORE_FIRST_LINE)) firstLine = component; else if (str.equals(AFTER_LAST_LINE)) lastLine = component; else if (str.equals(BEFORE_LINE_BEGINS)) firstItem = component; else if (str.equals(AFTER_LINE_ENDS)) lastItem = component; else throw new IllegalArgumentException("Constraint value not valid: " + str);}
| 6,633
|
calcCompSize(Component comp, int what){ if (comp == null) return new Dimension(0, 0); if (what == MIN) return comp.getMinimumSize(); else if (what == MAX) return comp.getMaximumSize(); return comp.getPreferredSize();}
|
calcCompSize(Component comp, int what){ if (comp == null || !comp.isVisible()) return new Dimension(0, 0); if (what == MIN) return comp.getMinimumSize(); else if (what == MAX) return comp.getMaximumSize(); return comp.getPreferredSize();}
| 6,634
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + hgap; int x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + vgap; int y3 = t.height - i.bottom - s.height; int hh = y3-y2-vgap; setBounds(center, x2, y2, x3-x2-hgap, hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + hgap; int x3 = Math.max(x2 + w.width + hgap, t.width - i.right - e.width); int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + vgap; int y3 = t.height - i.bottom - s.height; int hh = y3-y2-vgap; setBounds(center, x2, y2, x3-x2-hgap, hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
| 6,635
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + hgap; int x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + vgap; int y3 = t.height - i.bottom - s.height; int hh = y3-y2-vgap; setBounds(center, x2, y2, x3-x2-hgap, hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
|
layoutContainer(Container target){ synchronized (target.getTreeLock ()) { Insets i = target.getInsets(); ComponentOrientation orient = target.getComponentOrientation (); boolean left_to_right = orient.isLeftToRight (); Component my_north = north; Component my_east = east; Component my_south = south; Component my_west = west; // Note that we currently don't handle vertical layouts. Neither // does JDK 1.3. if (firstLine != null) my_north = firstLine; if (lastLine != null) my_south = lastLine; if (firstItem != null) { if (left_to_right) my_west = firstItem; else my_east = firstItem; } if (lastItem != null) { if (left_to_right) my_east = lastItem; else my_west = lastItem; } Dimension c = calcCompSize(center, PREF); Dimension n = calcCompSize(my_north, PREF); Dimension s = calcCompSize(my_south, PREF); Dimension e = calcCompSize(my_east, PREF); Dimension w = calcCompSize(my_west, PREF); Dimension t = target.getSize(); /* <-> hgap <-> hgap +----------------------------+ } |t | } i.top | +----------------------+ | --- y1 } | |n | | | +----------------------+ | } vgap | +---+ +----------+ +---+ | --- y2 } } | |w | |c | |e | | } hh | +---+ +----------+ +---+ | } vgap } | +----------------------+ | --- y3 } | |s | | | +----------------------+ | } | | } i.bottom +----------------------------+ } |x1 |x2 |x3 <----------------------> <--> ww <--> i.left i.right */ int x1 = i.left; int x2 = x1 + w.width + hgap; int x3 = t.width - i.right - e.width; int ww = t.width - i.right - i.left; int y1 = i.top; int y2 = y1 + n.height + vgap; int midh = Math.max(e.height, Math.max(w.height, c.height)); int y3 = Math.max(y2 + midh + vgap, t.height - i.bottom - s.height); int hh = y3-y2-vgap; setBounds(center, x2, y2, x3-x2-hgap, hh); setBounds(my_north, x1, y1, ww, n.height); setBounds(my_south, x1, y3, ww, s.height); setBounds(my_west, x1, y2, w.width, hh); setBounds(my_east, x3, y2, e.width, hh); }}
| 6,636
|
public void keyPressed(KeyEvent e) { }
|
public void keyPressed(KeyEvent evt) { }
| 6,637
|
private void updateSelection(boolean controlPressed) { if (table.getRowSelectionAllowed()) { int lo_row = table.rowAtPoint(begin); int hi_row = table.rowAtPoint(curr); ListSelectionModel rowModel = table.getSelectionModel(); if (lo_row != -1 && hi_row != -1) { if (controlPressed && rowModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) rowModel.addSelectionInterval(lo_row, hi_row); else rowModel.setSelectionInterval(lo_row, hi_row); } } if (table.getColumnSelectionAllowed()) { int lo_col = table.columnAtPoint(begin); int hi_col = table.columnAtPoint(curr); ListSelectionModel colModel = table.getColumnModel(). getSelectionModel(); if (lo_col != -1 && hi_col != -1) { if (controlPressed && colModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) colModel.addSelectionInterval(lo_col, hi_col); else colModel.setSelectionInterval(lo_col, hi_col); } } }
|
private void updateSelection(boolean controlPressed) { if (table.getRowSelectionAllowed()) { int lo_row = table.rowAtPoint(begin); int hi_row = table.rowAtPoint(curr); ListSelectionModel rowModel = table.getSelectionModel(); if (lo_row != -1 && hi_row != -1) { if (controlPressed && rowModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) rowModel.addSelectionInterval(lo_row, hi_row); else rowModel.setSelectionInterval(lo_row, hi_row); } } if (table.getColumnSelectionAllowed()) { int lo_col = table.columnAtPoint(begin); int hi_col = table.columnAtPoint(curr); ListSelectionModel colModel = table.getColumnModel(). getSelectionModel(); if (lo_col != -1 && hi_col != -1) { if (controlPressed && colModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) colModel.addSelectionInterval(lo_col, hi_col); else colModel.setSelectionInterval(lo_col, hi_col); } } }
| 6,639
|
private void updateSelection(boolean controlPressed) { if (table.getRowSelectionAllowed()) { int lo_row = table.rowAtPoint(begin); int hi_row = table.rowAtPoint(curr); ListSelectionModel rowModel = table.getSelectionModel(); if (lo_row != -1 && hi_row != -1) { if (controlPressed && rowModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) rowModel.addSelectionInterval(lo_row, hi_row); else rowModel.setSelectionInterval(lo_row, hi_row); } } if (table.getColumnSelectionAllowed()) { int lo_col = table.columnAtPoint(begin); int hi_col = table.columnAtPoint(curr); ListSelectionModel colModel = table.getColumnModel(). getSelectionModel(); if (lo_col != -1 && hi_col != -1) { if (controlPressed && colModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) colModel.addSelectionInterval(lo_col, hi_col); else colModel.setSelectionInterval(lo_col, hi_col); } } }
|
private void updateSelection(boolean controlPressed) { if (table.getRowSelectionAllowed()) { int lo_row = table.rowAtPoint(begin); int hi_row = table.rowAtPoint(curr); ListSelectionModel rowModel = table.getSelectionModel(); if (lo_row != -1 && hi_row != -1) { if (controlPressed && rowModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) rowModel.addSelectionInterval(lo_row, hi_row); else rowModel.setSelectionInterval(lo_row, hi_row); if (table.getColumnSelectionAllowed()) { int lo_col = table.columnAtPoint(begin); int hi_col = table.columnAtPoint(curr); ListSelectionModel colModel = table.getColumnModel(). getSelectionModel(); if (lo_col != -1 && hi_col != -1) { if (controlPressed && colModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) colModel.addSelectionInterval(lo_col, hi_col); else colModel.setSelectionInterval(lo_col, hi_col);
| 6,640
|
private void updateSelection(boolean controlPressed) { if (table.getRowSelectionAllowed()) { int lo_row = table.rowAtPoint(begin); int hi_row = table.rowAtPoint(curr); ListSelectionModel rowModel = table.getSelectionModel(); if (lo_row != -1 && hi_row != -1) { if (controlPressed && rowModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) rowModel.addSelectionInterval(lo_row, hi_row); else rowModel.setSelectionInterval(lo_row, hi_row); } } if (table.getColumnSelectionAllowed()) { int lo_col = table.columnAtPoint(begin); int hi_col = table.columnAtPoint(curr); ListSelectionModel colModel = table.getColumnModel(). getSelectionModel(); if (lo_col != -1 && hi_col != -1) { if (controlPressed && colModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) colModel.addSelectionInterval(lo_col, hi_col); else colModel.setSelectionInterval(lo_col, hi_col); } } }
|
private void updateSelection(boolean controlPressed) { if (table.getRowSelectionAllowed()) { int lo_row = table.rowAtPoint(begin); int hi_row = table.rowAtPoint(curr); ListSelectionModel rowModel = table.getSelectionModel(); if (lo_row != -1 && hi_row != -1) { if (controlPressed && rowModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) rowModel.addSelectionInterval(lo_row, hi_row); else rowModel.setSelectionInterval(lo_row, hi_row); } } if (table.getColumnSelectionAllowed()) { int lo_col = table.columnAtPoint(begin); int hi_col = table.columnAtPoint(curr); ListSelectionModel colModel = table.getColumnModel(). getSelectionModel(); if (lo_col != -1 && hi_col != -1) { if (controlPressed && colModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) colModel.addSelectionInterval(lo_col, hi_col); else colModel.setSelectionInterval(lo_col, hi_col); } } }
| 6,641
|
public final OutputStream _invoke(String method, InputStream input, ResponseHandler rh ) { OutputStream output = null; if (method.equals("destroy")) { // The "destroy" has been invoked. destroy(); output = rh.createReply(); } else if (method.equals("copy")) { // The "copy" has been invoked. org.omg.CORBA.Object returns = copy(); output = rh.createReply(); output.write_Object(this); } else if (method.equals("policy_type")) { // The "policy_type" has been invoked. int returns = policy_type(); output = rh.createReply(); output.write_long(returns); } else if (method.equals("value")) { // The "value" can be invoked on the children types // and must return an integer, representing the policy value // (CORBA enumeration). output = rh.createReply(); output.write_long(policyCode); } else throw new BAD_OPERATION(method, 0, CompletionStatus.COMPLETED_MAYBE); return output; }
|
public final OutputStream _invoke(String method, InputStream input, ResponseHandler rh ) { OutputStream output = null; if (method.equals("destroy")) { // The "destroy" has been invoked. destroy(); output = rh.createReply(); } else if (method.equals("copy")) { // The "copy" has been invoked. org.omg.CORBA.Object returns = copy(); output = rh.createReply(); output.write_Object(this); } else if (method.equals("policy_type")) { // The "policy_type" has been invoked. int returns = policy_type(); output = rh.createReply(); output.write_long(returns); } else if (method.equals("value")) { // The "value" can be invoked on the children types // and must return an integer, representing the policy value // (CORBA enumeration). output = rh.createReply(); output.write_long(policyCode); } else throw new BAD_OPERATION(method, Minor.Method, CompletionStatus.COMPLETED_MAYBE); return output; }
| 6,643
|
public FatLfnDirectory(FatFileSystem fs, int nrEntries) { super(fs, nrEntries); }
|
public FatLfnDirectory(FatFileSystem fs, int nrEntries) { super(fs, nrEntries); }
| 6,644
|
public synchronized void write(BlockDeviceAPI device, long offset) throws IOException { if (label != null) applyLabel(); final byte[] data = new byte[entries.size() * 32]; write(data); device.write(offset, data, 0, data.length); resetDirty(); }
|
protected synchronized void write() throws IOException { if (label != null) applyLabel(); final byte[] data = new byte[entries.size() * 32]; write(data); device.write(offset, data, 0, data.length); resetDirty(); }
| 6,645
|
public synchronized void write(BlockDeviceAPI device, long offset) throws IOException { if (label != null) applyLabel(); final byte[] data = new byte[entries.size() * 32]; write(data); device.write(offset, data, 0, data.length); resetDirty(); }
|
public synchronized void write(BlockDeviceAPI device, long offset) throws IOException { if (label != null) applyLabel(); final byte[] data = new byte[entries.size() * 32]; write(data); file.write(0, data, 0, data.length); resetDirty(); }
| 6,646
|
private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false); setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(true); loadProps(); screen = new Screen5250(this,defaultProps); this.addComponentListener(this); if (!defaultProps.containsKey("width") || !defaultProps.containsKey("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(Integer.parseInt((String)defaultProps.get("width")), Integer.parseInt((String)defaultProps.get("height")) ); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } } }); addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { processVTKeyTyped(e); } public void keyPressed(KeyEvent ke) { processVTKeyPressed(ke); } public void keyReleased(KeyEvent e) { processVTKeyReleased(e); } }); keyMap = new KeyMapper(); keyMap.init(); /** * this is taken out right now look at the method for description */// initKeyBindings(); macros = new Macronizer(); macros.init(); keyPad.addActionListener(this); if (getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); jumpEvent = new SessionJumpEvent(this); }
|
private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false); setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(true); loadProps(); screen = new Screen5250(this,defaultProps); this.addComponentListener(this); if (!defaultProps.containsKey("width") || !defaultProps.containsKey("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(Integer.parseInt((String)defaultProps.get("width")), Integer.parseInt((String)defaultProps.get("height")) ); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } } }); addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { processVTKeyTyped(e); } public void keyPressed(KeyEvent ke) { processVTKeyPressed(ke); } public void keyReleased(KeyEvent e) { processVTKeyReleased(e); } }); keyMap = new KeyMapper(); keyMap.init(); /** * this is taken out right now look at the method for description */// initKeyBindings(); macros = new Macronizer(); macros.init(); keyPad.addActionListener(this); if (getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); jumpEvent = new SessionJumpEvent(this); }
| 6,650
|
private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false); setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(true); loadProps(); screen = new Screen5250(this,defaultProps); this.addComponentListener(this); if (!defaultProps.containsKey("width") || !defaultProps.containsKey("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(Integer.parseInt((String)defaultProps.get("width")), Integer.parseInt((String)defaultProps.get("height")) ); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } } }); addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { processVTKeyTyped(e); } public void keyPressed(KeyEvent ke) { processVTKeyPressed(ke); } public void keyReleased(KeyEvent e) { processVTKeyReleased(e); } }); keyMap = new KeyMapper(); keyMap.init(); /** * this is taken out right now look at the method for description */// initKeyBindings(); macros = new Macronizer(); macros.init(); keyPad.addActionListener(this); if (getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); jumpEvent = new SessionJumpEvent(this); }
|
private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false); setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(true); loadProps(); screen = new Screen5250(this,defaultProps); this.addComponentListener(this); if (!defaultProps.containsKey("width") || !defaultProps.containsKey("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(Integer.parseInt((String)defaultProps.get("width")), Integer.parseInt((String)defaultProps.get("height")) ); addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); else { screen.moveCursor(e); repaint(); getFocusForMe(); ); addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { processVTKeyTyped(e); public void keyPressed(KeyEvent ke) { processVTKeyPressed(ke); public void keyReleased(KeyEvent e) { processVTKeyReleased(e); ); keyMap = new KeyMapper(); keyMap.init(); /** * this is taken out right now look at the method for description */// initKeyBindings(); macros = new Macronizer(); macros.init(); keyPad.addActionListener(this); if (getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); jumpEvent = new SessionJumpEvent(this);
| 6,651
|
public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } }
|
public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } }
| 6,652
|
public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } }
|
public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { screen.sendKeys("[enter]"); else { screen.moveCursor(e); repaint(); getFocusForMe();
| 6,653
|
private void jbInit() throws Exception { this.setSize(new Dimension(400,300)); Properties sesProps = new Properties(); // Start loading properties - Host must exist sesProps.put(SESSION_HOST,getParameter("host")); if (isSpecified("-e")) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p")) { sesProps.put(SESSION_HOST_PORT,getParameter("-p")); }// if (isSpecified("-f",args))// propFileName = getParm("-f",args); if (isSpecified("-cp")) sesProps.put(SESSION_CODE_PAGE ,getParameter("-cp")); if (isSpecified("-gui")) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132")) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // socks proxy host argument if (isSpecified("-sph")) { sesProps.put(SESSION_PROXY_HOST ,getParameter("-sph")); } // socks proxy port argument if (isSpecified("-spp")) sesProps.put(SESSION_PROXY_PORT ,getParameter("-spp")); // check if device name is specified if (isSpecified("-dn")) sesProps.put(SESSION_DEVICE_NAME ,getParameter("-dn")); if (isSpecified("-L")) LangTool.init(parseLocale(getParameter("-L"))); else LangTool.init(); manager = new SessionManager(); Session s = manager.openSession(sesProps,"","Test Applet"); s.grabFocus(); this.getContentPane().add(s); s.connect(); }
|
private void jbInit() throws Exception { this.setSize(new Dimension(400,300)); Properties sesProps = new Properties(); // Start loading properties - Host must exist sesProps.put(SESSION_HOST,getParameter("host")); if (isSpecified("-e")) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p")) { sesProps.put(SESSION_HOST_PORT,getParameter("-p")); }// if (isSpecified("-f",args))// propFileName = getParm("-f",args); if (isSpecified("-cp")) sesProps.put(SESSION_CODE_PAGE ,getParameter("-cp")); if (isSpecified("-gui")) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132")) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // socks proxy host argument if (isSpecified("-sph")) { sesProps.put(SESSION_PROXY_HOST ,getParameter("-sph")); } // socks proxy port argument if (isSpecified("-spp")) sesProps.put(SESSION_PROXY_PORT ,getParameter("-spp")); // check if device name is specified if (isSpecified("-dn")) sesProps.put(SESSION_DEVICE_NAME ,getParameter("-dn")); if (isSpecified("-L")) LangTool.init(parseLocale(getParameter("-L"))); else LangTool.init(); manager = new SessionManager(); Session s = manager.openSession(sesProps,"","Test Applet"); s.grabFocus(); this.getContentPane().add(s); s.connect(); }
| 6,654
|
public static final AudioClip newAudioClip(URL url) { // This requires an implementation of AudioClip in gnu.java.applet. throw new Error("Not implemented"); }
|
public static final AudioClip newAudioClip(URL url) { // This requires an implementation of AudioClip in gnu.java.applet. return new URLAudioClip(url); }
| 6,656
|
protected String paramString() { return super.paramString(); }
|
protected String paramString() { StringBuffer sb = new StringBuffer(super.paramString()); sb.append(",defaultIcon="); if (icon != null) sb.append(icon); sb.append(",disabledIcon="); if (disabledIcon != null) sb.append(disabledIcon); sb.append(",horizontalAlignment="); sb.append(SwingUtilities.convertHorizontalAlignmentCodeToString( horizontalAlignment)); sb.append(",horizontalTextPosition="); sb.append(SwingUtilities.convertHorizontalAlignmentCodeToString( horizontalTextPosition)); sb.append(",iconTextGap=").append(iconTextGap); sb.append(",labelFor="); if (labelFor != null) sb.append(labelFor); sb.append(",text="); if (text != null) sb.append(text); sb.append(",verticalAlignment="); sb.append(SwingUtilities.convertVerticalAlignmentCodeToString( verticalAlignment)); sb.append(",verticalTextPosition="); sb.append(SwingUtilities.convertVerticalAlignmentCodeToString( verticalTextPosition)); return sb.toString(); }
| 6,657
|
public void setLabelFor(Component c) { if (c != labelFor) { // We put the label into the client properties for the labeled // component so that it can be read by the AccessibleJComponent. // The other option would be to reserve a default visible field // in JComponent, but since this is relativly seldomly used, it // would be unnecessary waste of memory to do so. Component oldLabelFor = labelFor; if (oldLabelFor instanceof JComponent) { ((JComponent) oldLabelFor).putClientProperty(LABEL_PROPERTY, null); } labelFor = c; if (labelFor instanceof JComponent) { ((JComponent) labelFor).putClientProperty(LABEL_PROPERTY, this); } firePropertyChange("labelFor", oldLabelFor, labelFor); } }
|
public void setLabelFor(Component c) { if (c != labelFor) { // We put the label into the client properties for the labeled // component so that it can be read by the AccessibleJComponent. // The other option would be to reserve a default visible field // in JComponent, but since this is relativly seldomly used, it // would be unnecessary waste of memory to do so. if (oldLabelFor instanceof JComponent) { ((JComponent) oldLabelFor).putClientProperty(LABEL_PROPERTY, null); } labelFor = c; if (labelFor instanceof JComponent) { ((JComponent) labelFor).putClientProperty(LABEL_PROPERTY, this); } firePropertyChange("labelFor", oldLabelFor, labelFor); } }
| 6,658
|
public void setLabelFor(Component c) { if (c != labelFor) { // We put the label into the client properties for the labeled // component so that it can be read by the AccessibleJComponent. // The other option would be to reserve a default visible field // in JComponent, but since this is relativly seldomly used, it // would be unnecessary waste of memory to do so. Component oldLabelFor = labelFor; if (oldLabelFor instanceof JComponent) { ((JComponent) oldLabelFor).putClientProperty(LABEL_PROPERTY, null); } labelFor = c; if (labelFor instanceof JComponent) { ((JComponent) labelFor).putClientProperty(LABEL_PROPERTY, this); } firePropertyChange("labelFor", oldLabelFor, labelFor); } }
|
public void setLabelFor(Component c) { if (c != labelFor) { // We put the label into the client properties for the labeled // component so that it can be read by the AccessibleJComponent. // The other option would be to reserve a default visible field // in JComponent, but since this is relativly seldomly used, it // would be unnecessary waste of memory to do so. Component oldLabelFor = labelFor; if (oldLabelFor instanceof JComponent) { ((JComponent) oldLabelFor).putClientProperty(LABEL_PROPERTY, null); } if (labelFor instanceof JComponent) { ((JComponent) labelFor).putClientProperty(LABEL_PROPERTY, this); } firePropertyChange("labelFor", oldLabelFor, labelFor); } }
| 6,659
|
public void setLabelFor(Component c) { if (c != labelFor) { // We put the label into the client properties for the labeled // component so that it can be read by the AccessibleJComponent. // The other option would be to reserve a default visible field // in JComponent, but since this is relativly seldomly used, it // would be unnecessary waste of memory to do so. Component oldLabelFor = labelFor; if (oldLabelFor instanceof JComponent) { ((JComponent) oldLabelFor).putClientProperty(LABEL_PROPERTY, null); } labelFor = c; if (labelFor instanceof JComponent) { ((JComponent) labelFor).putClientProperty(LABEL_PROPERTY, this); } firePropertyChange("labelFor", oldLabelFor, labelFor); } }
|
public void setLabelFor(Component c) { if (c != labelFor) { // We put the label into the client properties for the labeled // component so that it can be read by the AccessibleJComponent. // The other option would be to reserve a default visible field // in JComponent, but since this is relativly seldomly used, it // would be unnecessary waste of memory to do so. Component oldLabelFor = labelFor; if (oldLabelFor instanceof JComponent) { ((JComponent) oldLabelFor).putClientProperty(LABEL_PROPERTY, null); } labelFor = c; if (labelFor instanceof JComponent) { ((JComponent) labelFor).putClientProperty(LABEL_PROPERTY, this); } } }
| 6,660
|
protected AbstractDirectory(FatFileSystem fs, FatFile myFile) { this(fs, (int)myFile.getLength() / 32, myFile); }
|
protected AbstractDirectory(FatFileSystem fs, FatFile myFile) { this(fs, (int)myFile.getLength() / 32, myFile); }
| 6,661
|
TemplateNode clone(Stylesheet stylesheet) { int len = sortKeys.size(); List sortKeys2 = new ArrayList(len); for (int i = 0; i < len; i++) sortKeys2.add(((Key) sortKeys.get(i)).clone(stylesheet)); len = withParams.size(); List withParams2 = new ArrayList(len); for (int i = 0; i < len; i++) withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet)); TemplateNode ret = new ApplyTemplatesNode(select.clone(stylesheet), mode, sortKeys2, withParams2, isDefault); if (children != null) ret.children = children.clone(stylesheet); if (next != null) ret.next = next.clone(stylesheet); return ret; }
|
TemplateNode clone(Stylesheet stylesheet) { int len = sortKeys != null ? sortKeys.size() : 0; List sortKeys2 = new ArrayList(len); for (int i = 0; i < len; i++) sortKeys2.add(((Key) sortKeys.get(i)).clone(stylesheet)); len = withParams.size(); List withParams2 = new ArrayList(len); for (int i = 0; i < len; i++) withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet)); TemplateNode ret = new ApplyTemplatesNode(select.clone(stylesheet), mode, sortKeys2, withParams2, isDefault); if (children != null) ret.children = children.clone(stylesheet); if (next != null) ret.next = next.clone(stylesheet); return ret; }
| 6,662
|
public String expand(String[] params){ //if(paramCount != params.length) return null; String exp = body; for(int i = 0; i < localLabels.length; i++){ exp = exp.replaceAll(localLabels[i], "__jnasm_macro_local_label_" + localLabelCount ++); } for(int i = 0; i < params.length; i++){ exp = exp.replaceAll("%"+(i + 1), params[i]); } if(maxParamCount > params.length){ if(defaultValues == null){ for(int i = params.length; i < maxParamCount; i++){ exp = exp.replaceAll("%"+(i + 1), ""); } }else{ for(int i = params.length; i < maxParamCount; i++){ if(defaultValues.length > i - params.length){ exp = exp.replaceAll("%"+(i + 1), defaultValues[i - params.length]); }else{ exp = exp.replaceAll("%"+(i + 1), ""); } } } } return exp; }
|
public String expand(String[] params){ //if(paramCount != params.length) return null; String exp = body; for(int i = 0; i < localLabels.length; i++){ exp = exp.replaceAll(localLabels[i], "__jnasm_macro_local_label_" + localLabelCount ++); } for(int i = 0; i < params.length; i++){ String par = params[i]; par = (par == null) ? "" : par.trim(); exp = exp.replaceAll("%"+(i + 1), par); } if(maxParamCount > params.length){ if(defaultValues == null){ for(int i = params.length; i < maxParamCount; i++){ exp = exp.replaceAll("%"+(i + 1), ""); } }else{ for(int i = params.length; i < maxParamCount; i++){ if(defaultValues.length > i - params.length){ exp = exp.replaceAll("%"+(i + 1), defaultValues[i - params.length]); }else{ exp = exp.replaceAll("%"+(i + 1), ""); } } } } return exp; }
| 6,663
|
public String expand(String[] params){ //if(paramCount != params.length) return null; String exp = body; for(int i = 0; i < localLabels.length; i++){ exp = exp.replaceAll(localLabels[i], "__jnasm_macro_local_label_" + localLabelCount ++); } for(int i = 0; i < params.length; i++){ exp = exp.replaceAll("%"+(i + 1), params[i]); } if(maxParamCount > params.length){ if(defaultValues == null){ for(int i = params.length; i < maxParamCount; i++){ exp = exp.replaceAll("%"+(i + 1), ""); } }else{ for(int i = params.length; i < maxParamCount; i++){ if(defaultValues.length > i - params.length){ exp = exp.replaceAll("%"+(i + 1), defaultValues[i - params.length]); }else{ exp = exp.replaceAll("%"+(i + 1), ""); } } } } return exp; }
|
public String expand(String[] params){ //if(paramCount != params.length) return null; String exp = body; for(int i = 0; i < localLabels.length; i++){ exp = exp.replaceAll(localLabels[i], "__jnasm_macro_local_label_" + localLabelCount ++); } for(int i = 0; i < params.length; i++){ exp = exp.replaceAll("%"+(i + 1), params[i]); } if(maxParamCount > params.length){ if(defaultValues == null){ for(int i = params.length; i < maxParamCount; i++){ exp = exp.replaceAll("%"+(i + 1), ""); } }else{ for(int i = params.length; i < maxParamCount; i++){ if(defaultValues.length > i - params.length){ String def = defaultValues[i - params.length]; def = (def == null) ? "" : def.trim(); exp = exp.replaceAll("%"+(i + 1), def); }else{ exp = exp.replaceAll("%"+(i + 1), ""); } } } } return exp; }
| 6,664
|
public Boolean isTraversable(File value0) { return null; // TODO } // isTraversable()
|
public Boolean isTraversable(File value0) { return null; // TODO } // isTraversable()
| 6,665
|
MenuComponent(){ if (GraphicsEnvironment.isHeadless()) throw new HeadlessException ();}
|
MenuComponent(){ if (GraphicsEnvironment.isHeadless()) throw new HeadlessException ();}
| 6,666
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.