bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public void executeScriptFile(Session session, String scriptFile) throws InterpreterDriver.InterpreterException { try { final Session s1 = session; final String s2 = scriptFile; s1.setMacroRunning(true); Runnable interpretIt = new Runnable() { public void run() { _interpreter.set("session",s1); _interpreter.execfile(s2); } }; // lets start interpreting it. Thread interpThread = new Thread(interpretIt); interpThread.setDaemon(true); interpThread.start(); } catch (PyException ex) { throw new InterpreterDriver.InterpreterException(ex); } catch (Exception ex2) { throw new InterpreterDriver.InterpreterException(ex2); } }
|
public void executeScriptFile(Session session, String scriptFile) throws InterpreterDriver.InterpreterException { try { final Session s1 = session; final String s2 = scriptFile; s1.setMacroRunning(true); Runnable interpretIt = new Runnable() { public void run() { _interpreter = new PythonInterpreter(); _interpreter.set("_session",s1); _interpreter.execfile(s2); } }; // lets start interpreting it. Thread interpThread = new Thread(interpretIt); interpThread.setDaemon(true); interpThread.start(); } catch (PyException ex) { throw new InterpreterDriver.InterpreterException(ex); } catch (Exception ex2) { throw new InterpreterDriver.InterpreterException(ex2); } }
| 5,369
|
public void run() { _interpreter.set("session",s1); _interpreter.execfile(s2); }
|
public void run() { _interpreter = new PythonInterpreter(); _interpreter.set("_session",s1); _interpreter.execfile(s2); }
| 5,370
|
public Variable getNewVariable() { count += 1; System.out.println("getNewVariable(): " + variable); Variable var = (Variable) variable.clone(); var.setSSAValue(count); stack.add(var); System.out.println("getNewVariable(): " + var); return var; }
|
public Variable getNewVariable() { count += 1; Variable var = (Variable) variable.clone(); var.setSSAValue(count); stack.add(var); System.out.println("getNewVariable(): " + var); return var; }
| 5,371
|
public Variable getNewVariable() { count += 1; System.out.println("getNewVariable(): " + variable); Variable var = (Variable) variable.clone(); var.setSSAValue(count); stack.add(var); System.out.println("getNewVariable(): " + var); return var; }
|
public Variable getNewVariable() { count += 1; System.out.println("getNewVariable(): " + variable); Variable var = (Variable) variable.clone(); var.setSSAValue(count); stack.add(var); return var; }
| 5,372
|
public Variable peek() { System.out.println("peek(): " + variable); int n = stack.size(); // TODO don't know if this right, but it avoids exceptions for certain // rewritePhiParams calls if (n <= 0) { return null; } Variable var = (Variable) stack.get(n - 1); System.out.println("peek(): " + var); return var; }
|
public Variable peek() { int n = stack.size(); // TODO don't know if this right, but it avoids exceptions for certain // rewritePhiParams calls if (n <= 0) { return null; } Variable var = (Variable) stack.get(n - 1); System.out.println("peek(): " + var); return var; }
| 5,373
|
public Variable peek() { System.out.println("peek(): " + variable); int n = stack.size(); // TODO don't know if this right, but it avoids exceptions for certain // rewritePhiParams calls if (n <= 0) { return null; } Variable var = (Variable) stack.get(n - 1); System.out.println("peek(): " + var); return var; }
|
public Variable peek() { System.out.println("peek(): " + variable); int n = stack.size(); // TODO don't know if this right, but it avoids exceptions for certain // rewritePhiParams calls if (n <= 0) { if (variable instanceof MethodArgument) { return variable; } else { return null; } } Variable var = (Variable) stack.get(n - 1); System.out.println("peek(): " + var); return var; }
| 5,374
|
public Variable peek() { System.out.println("peek(): " + variable); int n = stack.size(); // TODO don't know if this right, but it avoids exceptions for certain // rewritePhiParams calls if (n <= 0) { return null; } Variable var = (Variable) stack.get(n - 1); System.out.println("peek(): " + var); return var; }
|
public Variable peek() { System.out.println("peek(): " + variable); int n = stack.size(); // TODO don't know if this right, but it avoids exceptions for certain // rewritePhiParams calls if (n <= 0) { return null; } Variable var = (Variable) stack.get(n - 1); return var; }
| 5,375
|
public Variable pop() { Variable var = (Variable) stack.remove(stack.size() - 1); System.out.println("pop(): " + var); return var; }
|
public Variable pop() { Variable var = (Variable) stack.remove(stack.size() - 1); return var; }
| 5,376
|
public void paint(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); SwingUtilities.calculateInnerArea(b, vr); String text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f), b.getText(), currentIcon(b), b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), vr, ir, tr, b.getIconTextGap() + defaultTextShiftOffset); if ((b.getModel().isArmed() && b.getModel().isPressed()) || b.isSelected()) paintButtonPressed(g, b); else paintButtonNormal(g, vr, c); paintIcon(g, c, ir); if (text != null) paintText(g, b, tr, text); if (b.isFocusOwner()) paintFocus(g, b, vr, tr, ir); }
|
public void paint(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); if (b.isBorderPainted()) SwingUtilities.calculateInnerArea(b, vr); else vr = SwingUtilities.getLocalBounds(b); String text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f), b.getText(), currentIcon(b), b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), vr, ir, tr, b.getIconTextGap() + defaultTextShiftOffset); if ((b.getModel().isArmed() && b.getModel().isPressed()) || b.isSelected()) paintButtonPressed(g, b); else paintButtonNormal(g, vr, c); paintIcon(g, c, ir); if (text != null) paintText(g, b, tr, text); if (b.isFocusOwner()) paintFocus(g, b, vr, tr, ir); }
| 5,377
|
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c) { Rectangle r0 = null; Rectangle r1 = null; Rectangle rect = bounds.getBounds(); try { r0 = c.modelToView(p0); r1 = c.modelToView(p1); } catch (BadLocationException e) { // This should never occur. return; } if (r0 == null || r1 == null) return; if (color == null) g.setColor(c.getSelectionColor()); else g.setColor(color); // Check if only one line to highlight. if (r0.y == r1.y) { r0.width = r1.x - r0.x; paintHighlight(g, r0); return; } // First line, from p0 to end-of-line. r0.width = rect.x + rect.width - r0.x; paintHighlight(g, r0); // FIXME: All the full lines in between, if any (assumes that all lines // have the same height -- not a good assumption with JEditorPane/JTextPane). r0.y += r0.height; r0.x = rect.x; while (r0.y < r1.y) { paintHighlight(g, r0); r0.y += r0.height; } // Last line, from beginnin-of-line to p1. paintHighlight(g, r1); }
|
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c) { Rectangle r0 = null; Rectangle r1 = null; Rectangle rect = bounds.getBounds(); try { r0 = c.modelToView(p0); r1 = c.modelToView(p1); } catch (BadLocationException e) { // This should never occur. return; } if (r0 == null || r1 == null) return; if (color == null) g.setColor(c.getSelectionColor()); else g.setColor(color); // Check if only one line to highlight. if (r0.y == r1.y) { r0.width = r1.x - r0.x; paintHighlight(g, r0); return; } // First line, from p0 to end-of-line. r0.width = rect.x + rect.width - r0.x; paintHighlight(g, r0); // FIXME: All the full lines in between, if any (assumes that all lines // have the same height -- not a good assumption with JEditorPane/JTextPane). r0.y += r0.height; r0.x = rect.x; while (r0.y < r1.y) { paintHighlight(g, r0); r0.y += r0.height; } // Last line, from beginnin-of-line to p1. r0.width = r1.x + r1.width - 1; paintHighlight(g, r0); }
| 5,379
|
public void changeHighlight(Object tag, int p0, int p1) throws BadLocationException { checkPositions(p0, p1); HighlightEntry entry = (HighlightEntry) tag; entry.p0 = p0; entry.p1 = p1; }
|
public void changeHighlight(Object tag, int n0, int n1) throws BadLocationException { checkPositions(p0, p1); HighlightEntry entry = (HighlightEntry) tag; entry.p0 = p0; entry.p1 = p1; }
| 5,381
|
public void changeHighlight(Object tag, int p0, int p1) throws BadLocationException { checkPositions(p0, p1); HighlightEntry entry = (HighlightEntry) tag; entry.p0 = p0; entry.p1 = p1; }
|
public void changeHighlight(Object tag, int p0, int p1) throws BadLocationException { int o0, o1; checkPositions(n0, n1); HighlightEntry entry = (HighlightEntry) tag; entry.p0 = p0; entry.p1 = p1; }
| 5,382
|
public void changeHighlight(Object tag, int p0, int p1) throws BadLocationException { checkPositions(p0, p1); HighlightEntry entry = (HighlightEntry) tag; entry.p0 = p0; entry.p1 = p1; }
|
public void changeHighlight(Object tag, int p0, int p1) throws BadLocationException { checkPositions(p0, p1); HighlightEntry entry = (HighlightEntry) tag; entry.p0 = p0; entry.p1 = p1; }
| 5,383
|
public Highlighter.Highlight[] getHighlights() { return null; }
|
public Highlighter.Highlight[] getHighlights() { return (Highlighter.Highlight[]) highlights.toArray(new Highlighter.Highlight[highlights.size()]); }
| 5,384
|
public void paint(Graphics g) { // Check if there are any highlights. if (highlights.size() == 0) return; Shape bounds = textComponent.getBounds(); for (int index = 0; index < highlights.size(); ++index) { HighlightEntry entry = (HighlightEntry) highlights.get(index); entry.painter.paint(g, entry.p0, entry.p1, bounds, textComponent); } }
|
public void paint(Graphics g) { // Check if there are any highlights. if (size == 0) return; Shape bounds = textComponent.getBounds(); for (int index = 0; index < highlights.size(); ++index) { HighlightEntry entry = (HighlightEntry) highlights.get(index); entry.painter.paint(g, entry.p0, entry.p1, bounds, textComponent); } }
| 5,385
|
public void paint(Graphics g) { // Check if there are any highlights. if (highlights.size() == 0) return; Shape bounds = textComponent.getBounds(); for (int index = 0; index < highlights.size(); ++index) { HighlightEntry entry = (HighlightEntry) highlights.get(index); entry.painter.paint(g, entry.p0, entry.p1, bounds, textComponent); } }
|
public void paint(Graphics g) { // Check if there are any highlights. if (highlights.size() == 0) return; Insets insets = textComponent.getInsets(); Shape bounds = new Rectangle(insets.left, insets.top, textComponent.getWidth() - insets.left - insets.right, textComponent.getHeight() - insets.top - insets.bottom); for (int index = 0; index < highlights.size(); ++index) { HighlightEntry entry = (HighlightEntry) highlights.get(index); entry.painter.paint(g, entry.p0, entry.p1, bounds, textComponent); } }
| 5,386
|
public void paint(Graphics g) { // Check if there are any highlights. if (highlights.size() == 0) return; Shape bounds = textComponent.getBounds(); for (int index = 0; index < highlights.size(); ++index) { HighlightEntry entry = (HighlightEntry) highlights.get(index); entry.painter.paint(g, entry.p0, entry.p1, bounds, textComponent); } }
|
public void paint(Graphics g) { // Check if there are any highlights. if (highlights.size() == 0) return; Shape bounds = textComponent.getBounds(); for (int index = 0; index < size; ++index) { HighlightEntry entry = (HighlightEntry) highlights.get(index); entry.painter.paint(g, entry.p0, entry.p1, bounds, textComponent); } }
| 5,387
|
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { //base condition if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } synchronized (formatCommandList) { int end = formatCommandList.size(); for (int i = 0; i < end; i++) { Object command = formatCommandList.get(i); ((XMLDataIOStyle) command).specificIOStyleToXDF(outputstream, indent); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } } } } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
|
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { //base condition if (which > stop) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } synchronized (formatCommandList) { int end = formatCommandList.size(); for (int i = 0; i < end; i++) { Object command = formatCommandList.get(i); ((XMLDataIOStyle) command).specificIOStyleToXDF(outputstream, indent); if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } } } } else { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
| 5,389
|
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { //base condition if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } synchronized (formatCommandList) { int end = formatCommandList.size(); for (int i = 0; i < end; i++) { Object command = formatCommandList.get(i); ((XMLDataIOStyle) command).specificIOStyleToXDF(outputstream, indent); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } } } } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
|
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { //base condition if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } synchronized (formatCommandList) { int end = formatCommandList.size(); for (int i = 0; i < end; i++) { Object command = formatCommandList.get(i); ((XMLDataIOStyle) command).specificIOStyleToXDF(outputstream, indent); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } } } } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + Specification.getInstance().getPrettyXDFOutputIndentation(), which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
| 5,390
|
protected void specificIOStyleToXDF( OutputStream outputstream,String indent) { //write out nodes in formatCommandList synchronized (formatCommandList) { int stop = formatCommandList.size(); for (int i = 0; i <stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } ((XMLDataIOStyle) formatCommandList.get(i)).specificIOStyleToXDF(outputstream, indent); } } }
|
protected void specificIOStyleToXDF( OutputStream outputstream,String indent) { //write out nodes in formatCommandList synchronized (formatCommandList) { int stop = formatCommandList.size(); for (int i = 0; i <stop; i++) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } ((XMLDataIOStyle) formatCommandList.get(i)).specificIOStyleToXDF(outputstream, indent); } } }
| 5,391
|
public static Class Idl2class(String IDL) { String s = IDL; int a = s.indexOf(':') + 1; int b = s.lastIndexOf(':'); s = IDL.substring(a, b); if (s.startsWith(OMG_PREFIX)) s = JAVA_PREFIX + s.substring(OMG_PREFIX.length()); String cn = s.replace('/', '.'); try { return Class.forName(cn); } catch (ClassNotFoundException ex) { return null; } }
|
public static Class Idl2class(String IDL) { String s = IDL; int a = s.indexOf(':') + 1; int b = s.lastIndexOf(':'); s = IDL.substring(a, b); if (s.startsWith(OMG_PREFIX)) s = JAVA_PREFIX + s.substring(OMG_PREFIX.length()); String cn = s.replace('/', '.'); try { c = forName(cn); m_classes.put(IDL, c); return c; } catch (ClassNotFoundException ex) { return null; } }
| 5,393
|
public static java.lang.Object createObject(String idl, String suffix) { try { return Class.forName(toClassName(JAVA_PREFIX, idl) + suffix) .newInstance(); } catch (Exception ex) { try { return Class.forName(toClassName(CLASSPATH_PREFIX, idl) + suffix) .newInstance(); } catch (Exception exex) { return null; } } }
|
public static java.lang.Object createObject(String idl, String suffix) { try { return Class.forName(toClassName(JAVA_PREFIX, idl) + suffix) .newInstance(); } catch (Exception ex) { try { return Class.forName(toClassName(CLASSPATH_PREFIX, idl) + suffix) .newInstance(); } catch (Exception exex) { return null; } } }
| 5,395
|
public static java.lang.Object createObject(String idl, String suffix) { try { return Class.forName(toClassName(JAVA_PREFIX, idl) + suffix) .newInstance(); } catch (Exception ex) { try { return Class.forName(toClassName(CLASSPATH_PREFIX, idl) + suffix) .newInstance(); } catch (Exception exex) { return null; } } }
|
public static java.lang.Object createObject(String idl, String suffix) { try { return Class.forName(toClassName(JAVA_PREFIX, idl) + suffix) .newInstance(); } catch (Exception ex) { try { return Class.forName(toClassName(CLASSPATH_PREFIX, idl) + suffix) .newInstance(); } catch (Exception exex) { return null; } } }
| 5,396
|
public static boolean insertSysException(Any into, SystemException exception) { try { cdrBufOutput output = new cdrBufOutput(); String m_exception_id = toIDL(exception.getClass().getName()); output.write_string(m_exception_id); output.write_ulong(exception.minor); CompletionStatusHelper.write(output, exception.completed); String name = getDefaultName(m_exception_id); universalHolder h = new universalHolder(output); into.insert_Streamable(h); recordTypeCode r = new recordTypeCode(TCKind.tk_except); r.setId(m_exception_id); r.setName(name); into.type(r); return true; } catch (Exception ex) { ex.printStackTrace(); return false; } }
|
public static boolean insertSysException(Any into, SystemException exception) { try { cdrBufOutput output = new cdrBufOutput(); String m_exception_id = getRepositoryId(exception.getClass()); output.write_string(m_exception_id); output.write_ulong(exception.minor); CompletionStatusHelper.write(output, exception.completed); String name = getDefaultName(m_exception_id); universalHolder h = new universalHolder(output); into.insert_Streamable(h); recordTypeCode r = new recordTypeCode(TCKind.tk_except); r.setId(m_exception_id); r.setName(name); into.type(r); return true; } catch (Exception ex) { ex.printStackTrace(); return false; } }
| 5,398
|
protected abstract WritableRaster getDestinationRaster();
|
protected WritableRaster getDestinationRaster() { Rectangle db = getDeviceBounds(); if (destinationRaster == null) { int[] bandMasks = new int[]{ 0xFF0000, 0xFF00, 0xFF }; destinationRaster = Raster.createPackedRaster(DataBuffer.TYPE_INT, db.width, db.height, bandMasks, null); int x0 = destinationRaster.getMinX(); int x1 = destinationRaster.getWidth() + x0; int y0 = destinationRaster.getMinY(); int y1 = destinationRaster.getHeight() + y0; int numBands = destinationRaster.getNumBands(); for (int y = y0; y < y1; y++) { for (int x = x0; x < x1; x++) { for (int b = 0; b < numBands; b++) destinationRaster.setSample(x, y, b, 255); } } } return destinationRaster; }
| 5,399
|
public void intersect(Area a) { // XXX Implement. throw new Error("not implemented"); }
|
public void intersect(Area area) { // XXX Implement. throw new Error("not implemented"); }
| 5,401
|
public void intersect(Area a) { // XXX Implement. throw new Error("not implemented"); }
|
public void intersect(Area a) { // XXX Implement. if (isEmpty() || area.isEmpty()) { reset(); return; } if (equals(area)) return; Vector pathA = new Vector(); Area B = (Area) area.clone(); pathA.addAll(solids); pathA.addAll(holes); Vector pathB = new Vector(); pathB.addAll(B.solids); pathB.addAll(B.holes); int nNodes = 0; for (int i = 0; i < pathA.size(); i++) { Segment a = (Segment) pathA.elementAt(i); for (int j = 0; j < pathB.size(); j++) { Segment b = (Segment) pathB.elementAt(j); nNodes += createNodes(a, b); } } Vector paths = new Vector(); Vector segments = new Vector(); for (int i = 0; i < pathA.size(); i++) { Segment v = (Segment) pathA.elementAt(i); Segment path = v; if (! v.isSegmentOutside(area) && v.node == null) segments.add(v); boolean node = false; do { if ((v.node != null || node)) { node = (v.node != null); if (! v.isSegmentOutside(area)) segments.add(v); } v = v.next; } while (v != path); } for (int i = 0; i < pathB.size(); i++) { Segment v = (Segment) pathB.elementAt(i); Segment path = v; if (! v.isSegmentOutside(this) && v.node == null) segments.add(v); v = v.next; boolean node = false; do { if ((v.node != null || node)) { node = (v.node != null); if (! v.isSegmentOutside(this)) segments.add(v); } v = v.next; } while (v != path); } paths = weilerAtherton(segments); deleteRedundantPaths(paths); }
| 5,402
|
public GlyphVector createGlyphVector (FontRenderContext ctx, char[] chars){ return peer.createGlyphVector(this, ctx, new StringCharacterIterator(new String(chars)));}
|
public GlyphVector createGlyphVector (FontRenderContext ctx, char[] chars){ return peer.createGlyphVector(this, ctx, new StringCharacterIterator(new String(chars)));}
| 5,403
|
public int[] getComponents(Object pixel, int[] components, int offset) { // subclasses has to implement this method. throw new UnsupportedOperationException(); }
|
public int[] getComponents(int pixel, int[] components, int offset) { // subclasses has to implement this method. throw new UnsupportedOperationException(); }
| 5,404
|
private void parseO(final String o) throws AuthenticationException { this.replayDetection = false; boolean integrity = false; boolean confidentiality = false; String option; int i; final StringTokenizer st = new StringTokenizer(o.toLowerCase(), ","); while (st.hasMoreTokens()) { option = st.nextToken(); if (DEBUG && debuglevel > 6) debug(TRACE, "option: <" + option + ">"); if (option.equals(SRPRegistry.OPTION_REPLAY_DETECTION)) { replayDetection = true; } else if (option.startsWith(SRPRegistry.OPTION_INTEGRITY + "=")) { if (integrity) { throw new AuthenticationException( "Only one integrity algorithm may be chosen"); } else { option = option.substring(option.indexOf('=') + 1); if (DEBUG && debuglevel > 6) debug(TRACE, "algorithm: <" + option + ">"); for (i = 0; i < SRPRegistry.INTEGRITY_ALGORITHMS.length; i++) { if (SRPRegistry.INTEGRITY_ALGORITHMS[i].equals(option)) { chosenIntegrityAlgorithm = option; integrity = true; break; } } if (!integrity) { throw new AuthenticationException( "Unknown integrity algorithm: " + option); } } } else if (option.startsWith(SRPRegistry.OPTION_CONFIDENTIALITY + "=")) { if (confidentiality) { throw new AuthenticationException( "Only one confidentiality algorithm may be chosen"); } else { option = option.substring(option.indexOf('=') + 1); if (DEBUG && debuglevel > 6) debug(TRACE, "algorithm: <" + option + ">"); for (i = 0; i < SRPRegistry.CONFIDENTIALITY_ALGORITHMS.length; i++) { if (SRPRegistry.CONFIDENTIALITY_ALGORITHMS[i].equals(option)) { chosenConfidentialityAlgorithm = option; confidentiality = true; break; } } if (!confidentiality) { throw new AuthenticationException( "Unknown confidentiality algorithm: " + option); } } } else if (option.startsWith(SRPRegistry.OPTION_MAX_BUFFER_SIZE + "=")) { final String maxBufferSize = option.substring(option.indexOf('=') + 1); try { rawSendSize = Integer.parseInt(maxBufferSize); if (rawSendSize > Registry.SASL_BUFFER_MAX_LIMIT || rawSendSize < 1) throw new AuthenticationException( "Illegal value for 'maxbuffersize' option"); } catch (NumberFormatException x) { throw new AuthenticationException( SRPRegistry.OPTION_MAX_BUFFER_SIZE + "=" + String.valueOf(maxBufferSize), x); } } } // check if client did the right thing if (replayDetection) { if (!integrity) { throw new AuthenticationException( "Missing integrity protection algorithm " + "but replay detection is chosen"); } } if (mandatory.equals(SRPRegistry.OPTION_REPLAY_DETECTION)) { if (!replayDetection) { throw new AuthenticationException( "Replay detection is mandatory but was not chosen"); } } if (mandatory.equals(SRPRegistry.OPTION_INTEGRITY)) { if (!integrity) { throw new AuthenticationException( "Integrity protection is mandatory but was not chosen"); } } if (mandatory.equals(SRPRegistry.OPTION_CONFIDENTIALITY)) { if (!confidentiality) { throw new AuthenticationException( "Confidentiality is mandatory but was not chosen"); } } int blockSize = 0; if (chosenConfidentialityAlgorithm != null) { final IBlockCipher cipher = CipherFactory.getInstance(chosenConfidentialityAlgorithm); if (cipher != null) { blockSize = cipher.defaultBlockSize(); } else { // should not happen throw new AuthenticationException("Confidentiality algorithm (" + chosenConfidentialityAlgorithm + ") not available"); } } sIV = new byte[blockSize]; if (blockSize > 0) { new SecureRandom ().nextBytes(sIV); } }
|
private void parseO(final String o) throws AuthenticationException { this.replayDetection = false; boolean integrity = false; boolean confidentiality = false; String option; int i; final StringTokenizer st = new StringTokenizer(o.toLowerCase(), ","); while (st.hasMoreTokens()) { option = st.nextToken(); if (DEBUG && debuglevel > 6) debug(TRACE, "option: <" + option + ">"); if (option.equals(SRPRegistry.OPTION_REPLAY_DETECTION)) { replayDetection = true; } else if (option.startsWith(SRPRegistry.OPTION_INTEGRITY + "=")) { if (integrity) { throw new AuthenticationException( "Only one integrity algorithm may be chosen"); } else { option = option.substring(option.indexOf('=') + 1); if (DEBUG && debuglevel > 6) debug(TRACE, "algorithm: <" + option + ">"); for (i = 0; i < SRPRegistry.INTEGRITY_ALGORITHMS.length; i++) { if (SRPRegistry.INTEGRITY_ALGORITHMS[i].equals(option)) { chosenIntegrityAlgorithm = option; integrity = true; break; } } if (!integrity) { throw new AuthenticationException( "Unknown integrity algorithm: " + option); } } } else if (option.startsWith(SRPRegistry.OPTION_CONFIDENTIALITY + "=")) { if (confidentiality) { throw new AuthenticationException( "Only one confidentiality algorithm may be chosen"); } else { option = option.substring(option.indexOf('=') + 1); if (DEBUG && debuglevel > 6) debug(TRACE, "algorithm: <" + option + ">"); for (i = 0; i < SRPRegistry.CONFIDENTIALITY_ALGORITHMS.length; i++) { if (SRPRegistry.CONFIDENTIALITY_ALGORITHMS[i].equals(option)) { chosenConfidentialityAlgorithm = option; confidentiality = true; break; } } if (!confidentiality) { throw new AuthenticationException( "Unknown confidentiality algorithm: " + option); } } } else if (option.startsWith(SRPRegistry.OPTION_MAX_BUFFER_SIZE + "=")) { final String maxBufferSize = option.substring(option.indexOf('=') + 1); try { rawSendSize = Integer.parseInt(maxBufferSize); if (rawSendSize > Registry.SASL_BUFFER_MAX_LIMIT || rawSendSize < 1) throw new AuthenticationException( "Illegal value for 'maxbuffersize' option"); } catch (NumberFormatException x) { throw new AuthenticationException( SRPRegistry.OPTION_MAX_BUFFER_SIZE + "=" + String.valueOf(maxBufferSize), x); } } } // check if client did the right thing if (replayDetection) { if (!integrity) { throw new AuthenticationException( "Missing integrity protection algorithm " + "but replay detection is chosen"); } } if (mandatory.equals(SRPRegistry.OPTION_REPLAY_DETECTION)) { if (!replayDetection) { throw new AuthenticationException( "Replay detection is mandatory but was not chosen"); } } if (mandatory.equals(SRPRegistry.OPTION_INTEGRITY)) { if (!integrity) { throw new AuthenticationException( "Integrity protection is mandatory but was not chosen"); } } if (mandatory.equals(SRPRegistry.OPTION_CONFIDENTIALITY)) { if (!confidentiality) { throw new AuthenticationException( "Confidentiality is mandatory but was not chosen"); } } int blockSize = 0; if (chosenConfidentialityAlgorithm != null) { final IBlockCipher cipher = CipherFactory.getInstance(chosenConfidentialityAlgorithm); if (cipher != null) { blockSize = cipher.defaultBlockSize(); } else { // should not happen throw new AuthenticationException("Confidentiality algorithm (" + chosenConfidentialityAlgorithm + ") not available"); } } sIV = new byte[blockSize]; if (blockSize > 0) { new SecureRandom ().nextBytes(sIV); } }
| 5,405
|
private byte[] sendProtocolElements(final byte[] input) throws SaslException { if (DEBUG && debuglevel > 8) debug(TRACE, "==> sendProtocolElements()"); if (DEBUG && debuglevel > 6) debug(TRACE, "C: " + Util.dumpString(input)); // Client send U, I, sid, cn final InputBuffer frameIn = new InputBuffer(input); try { U = frameIn.getText(); // Extract username if (DEBUG && debuglevel > 6) debug(TRACE, "Got U (username): \"" + U + "\""); authorizationID = frameIn.getText(); // Extract authorisation ID if (DEBUG && debuglevel > 6) debug(TRACE, "Got I (userid): \"" + authorizationID + "\""); sid = frameIn.getEOS(); if (DEBUG && debuglevel > 6) debug(TRACE, "Got sid (session ID): " + new String(sid)); cn = frameIn.getOS(); if (DEBUG && debuglevel > 6) debug(TRACE, "Got cn (client nonce): " + Util.dumpString(cn)); cCB = frameIn.getEOS(); if (DEBUG && debuglevel > 6) debug(TRACE, "Got cCB (client channel binding): " + Util.dumpString(cCB)); } catch (IOException x) { if (x instanceof SaslException) { throw (SaslException) x; } throw new AuthenticationException("sendProtocolElements()", x); } // do/can we re-use? if (ServerStore.instance().isAlive(sid)) { final SecurityContext ctx = ServerStore.instance().restoreSession(sid); srp = SRP.instance(ctx.getMdName()); K = ctx.getK(); cIV = ctx.getClientIV(); sIV = ctx.getServerIV(); replayDetection = ctx.hasReplayDetection(); inCounter = ctx.getInCounter(); outCounter = ctx.getOutCounter(); inMac = ctx.getInMac(); outMac = ctx.getOutMac(); inCipher = ctx.getInCipher(); outCipher = ctx.getOutCipher(); if (sn == null || sn.length != 16) { sn = new byte[16]; } new SecureRandom ().nextBytes(sn); setupSecurityServices(false); final OutputBuffer frameOut = new OutputBuffer(); try { frameOut.setScalar(1, 0xFF); frameOut.setOS(sn); frameOut.setEOS(channelBinding); } catch (IOException x) { if (x instanceof SaslException) { throw (SaslException) x; } throw new AuthenticationException("sendProtocolElements()", x); } final byte[] result = frameOut.encode(); if (DEBUG && debuglevel > 8) debug(TRACE, "<== sendProtocolElements()"); if (DEBUG && debuglevel > 2) debug(INFO, "Old session..."); if (DEBUG && debuglevel > 2) debug(INFO, "S: " + Util.dumpString(result)); if (DEBUG && debuglevel > 2) debug(INFO, " sn = " + Util.dumpString(sn)); if (DEBUG && debuglevel > 2) debug(INFO, " sCB = " + Util.dumpString(channelBinding)); return result; } else { // new session authenticator.activate(properties); // ------------------------------------------------------------------- final HashMap mapB = new HashMap(); // mapB.put(SRP6KeyAgreement.HASH_FUNCTION, srp.newDigest()); mapB.put(SRP6KeyAgreement.HASH_FUNCTION, srp.getAlgorithm()); mapB.put(SRP6KeyAgreement.HOST_PASSWORD_DB, authenticator); try { serverHandler.init(mapB); OutgoingMessage out = new OutgoingMessage(); out.writeString(U); IncomingMessage in = new IncomingMessage(out.toByteArray()); out = serverHandler.processMessage(in); in = new IncomingMessage(out.toByteArray()); N = in.readMPI(); g = in.readMPI(); s = in.readMPI().toByteArray(); B = in.readMPI(); } catch (KeyAgreementException x) { throw new SaslException("sendProtocolElements()", x); } // ------------------------------------------------------------------- if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding N (modulus): " + Util.dump(N)); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding g (generator): " + Util.dump(g)); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding s (client's salt): " + Util.dumpString(s)); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding B (server ephemeral public key): " + Util.dump(B)); // The server creates an options list (L), which consists of a // comma-separated list of option strings that specify the security // service options the server supports. L = createL(); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding L (available options): \"" + L + "\""); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding sIV (server IV): " + Util.dumpString(sIV)); final OutputBuffer frameOut = new OutputBuffer(); try { frameOut.setScalar(1, 0x00); frameOut.setMPI(N); frameOut.setMPI(g); frameOut.setOS(s); frameOut.setMPI(B); frameOut.setText(L); } catch (IOException x) { if (x instanceof SaslException) { throw (SaslException) x; } throw new AuthenticationException("sendProtocolElements()", x); } final byte[] result = frameOut.encode(); if (DEBUG && debuglevel > 8) debug(TRACE, "<== sendProtocolElements()"); if (DEBUG && debuglevel > 2) debug(INFO, "New session..."); if (DEBUG && debuglevel > 2) debug(INFO, "S: " + Util.dumpString(result)); if (DEBUG && debuglevel > 2) debug(INFO, " N = 0x" + N.toString(16)); if (DEBUG && debuglevel > 2) debug(INFO, " g = 0x" + g.toString(16)); if (DEBUG && debuglevel > 2) debug(INFO, " s = " + Util.dumpString(s)); if (DEBUG && debuglevel > 2) debug(INFO, " B = 0x" + B.toString(16)); if (DEBUG && debuglevel > 2) debug(INFO, " L = " + L); return result; } }
|
private byte[] sendProtocolElements(final byte[] input) throws SaslException { if (DEBUG && debuglevel > 8) debug(TRACE, "==> sendProtocolElements()"); if (DEBUG && debuglevel > 6) debug(TRACE, "C: " + Util.dumpString(input)); // Client send U, I, sid, cn final InputBuffer frameIn = new InputBuffer(input); try { U = frameIn.getText(); // Extract username if (DEBUG && debuglevel > 6) debug(TRACE, "Got U (username): \"" + U + "\""); authorizationID = frameIn.getText(); // Extract authorisation ID if (DEBUG && debuglevel > 6) debug(TRACE, "Got I (userid): \"" + authorizationID + "\""); sid = frameIn.getEOS(); if (DEBUG && debuglevel > 6) debug(TRACE, "Got sid (session ID): " + new String(sid)); cn = frameIn.getOS(); if (DEBUG && debuglevel > 6) debug(TRACE, "Got cn (client nonce): " + Util.dumpString(cn)); cCB = frameIn.getEOS(); if (DEBUG && debuglevel > 6) debug(TRACE, "Got cCB (client channel binding): " + Util.dumpString(cCB)); } catch (IOException x) { if (x instanceof SaslException) { throw (SaslException) x; } throw new AuthenticationException("sendProtocolElements()", x); } // do/can we re-use? if (ServerStore.instance().isAlive(sid)) { final SecurityContext ctx = ServerStore.instance().restoreSession(sid); srp = SRP.instance(ctx.getMdName()); K = ctx.getK(); cIV = ctx.getClientIV(); sIV = ctx.getServerIV(); replayDetection = ctx.hasReplayDetection(); inCounter = ctx.getInCounter(); outCounter = ctx.getOutCounter(); inMac = ctx.getInMac(); outMac = ctx.getOutMac(); inCipher = ctx.getInCipher(); outCipher = ctx.getOutCipher(); if (sn == null || sn.length != 16) { sn = new byte[16]; } getDefaultPRNG().nextBytes(sn); setupSecurityServices(false); final OutputBuffer frameOut = new OutputBuffer(); try { frameOut.setScalar(1, 0xFF); frameOut.setOS(sn); frameOut.setEOS(channelBinding); } catch (IOException x) { if (x instanceof SaslException) { throw (SaslException) x; } throw new AuthenticationException("sendProtocolElements()", x); } final byte[] result = frameOut.encode(); if (DEBUG && debuglevel > 8) debug(TRACE, "<== sendProtocolElements()"); if (DEBUG && debuglevel > 2) debug(INFO, "Old session..."); if (DEBUG && debuglevel > 2) debug(INFO, "S: " + Util.dumpString(result)); if (DEBUG && debuglevel > 2) debug(INFO, " sn = " + Util.dumpString(sn)); if (DEBUG && debuglevel > 2) debug(INFO, " sCB = " + Util.dumpString(channelBinding)); return result; } else { // new session authenticator.activate(properties); // ------------------------------------------------------------------- final HashMap mapB = new HashMap(); // mapB.put(SRP6KeyAgreement.HASH_FUNCTION, srp.newDigest()); mapB.put(SRP6KeyAgreement.HASH_FUNCTION, srp.getAlgorithm()); mapB.put(SRP6KeyAgreement.HOST_PASSWORD_DB, authenticator); try { serverHandler.init(mapB); OutgoingMessage out = new OutgoingMessage(); out.writeString(U); IncomingMessage in = new IncomingMessage(out.toByteArray()); out = serverHandler.processMessage(in); in = new IncomingMessage(out.toByteArray()); N = in.readMPI(); g = in.readMPI(); s = in.readMPI().toByteArray(); B = in.readMPI(); } catch (KeyAgreementException x) { throw new SaslException("sendProtocolElements()", x); } // ------------------------------------------------------------------- if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding N (modulus): " + Util.dump(N)); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding g (generator): " + Util.dump(g)); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding s (client's salt): " + Util.dumpString(s)); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding B (server ephemeral public key): " + Util.dump(B)); // The server creates an options list (L), which consists of a // comma-separated list of option strings that specify the security // service options the server supports. L = createL(); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding L (available options): \"" + L + "\""); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding sIV (server IV): " + Util.dumpString(sIV)); final OutputBuffer frameOut = new OutputBuffer(); try { frameOut.setScalar(1, 0x00); frameOut.setMPI(N); frameOut.setMPI(g); frameOut.setOS(s); frameOut.setMPI(B); frameOut.setText(L); } catch (IOException x) { if (x instanceof SaslException) { throw (SaslException) x; } throw new AuthenticationException("sendProtocolElements()", x); } final byte[] result = frameOut.encode(); if (DEBUG && debuglevel > 8) debug(TRACE, "<== sendProtocolElements()"); if (DEBUG && debuglevel > 2) debug(INFO, "New session..."); if (DEBUG && debuglevel > 2) debug(INFO, "S: " + Util.dumpString(result)); if (DEBUG && debuglevel > 2) debug(INFO, " N = 0x" + N.toString(16)); if (DEBUG && debuglevel > 2) debug(INFO, " g = 0x" + g.toString(16)); if (DEBUG && debuglevel > 2) debug(INFO, " s = " + Util.dumpString(s)); if (DEBUG && debuglevel > 2) debug(INFO, " B = 0x" + B.toString(16)); if (DEBUG && debuglevel > 2) debug(INFO, " L = " + L); return result; } }
| 5,406
|
public void run() { try { // System.err.println("Registering shell in new thread."); // to // ensure // access // to // the // command // shell // in // this // new // thread? try { AccessController.doPrivileged(new InvokeAction(method, null, args)); } catch (PrivilegedActionException ex) { throw ex.getException(); } if (!isBlocking()) { // somebody already hit ctrl-c. } else { finished = true; // System.err.println("Finished invocation, notifying // blockers."); // done with invoke, stop waiting for a ctrl-c unblock(); } } catch (InvocationTargetException ex) { Throwable tex = ex.getTargetException(); if (tex instanceof SyntaxErrorException) { try { Help.getInfo(cx).usage(); } catch (HelpException ex1) { // Don't care ex1.printStackTrace(); } err.println(tex.getMessage()); unblock(); } else if (tex instanceof VmExit) { err.println(tex.getMessage()); unblock(); } else { err.println("Exception in command"); tex.printStackTrace(err); unblock(); } } catch (Exception ex) { err.println("Exception in command"); ex.printStackTrace(err); unblock(); } finished = true; }
|
public void run() { try { // System.err.println("Registering shell in new thread."); // to // ensure // access // to // the // command // shell // in // this // new // thread? try { AccessController.doPrivileged(new InvokeAction(method, null, args)); } catch (PrivilegedActionException ex) { throw ex.getException(); } if (!isBlocking()) { // somebody already hit ctrl-c. } else { finished = true; // System.err.println("Finished invocation, notifying // blockers."); // done with invoke, stop waiting for a ctrl-c unblock(); } } catch (InvocationTargetException ex) { Throwable tex = ex.getTargetException(); if (tex instanceof SyntaxErrorException) { try { Help.getInfo(cx).usage(); } catch (HelpException ex1) { // Don't care ex1.printStackTrace(); } err.println(tex.getMessage()); unblock(); } else if (tex instanceof VmExit) { err.println(tex.getMessage()); unblock(); } else { err.println("Exception in command"); tex.printStackTrace(err); unblock(); } } catch (Exception ex) { err.println("Exception in command"); ex.printStackTrace(err); unblock(); } finished = true; }
| 5,407
|
protected final void toggleDebug () { dumpBytes = !dumpBytes; if (dumpBytes) { try { if (fw == null) { fw = new FileOutputStream("log.txt"); dw = new BufferedOutputStream(fw); } } catch (FileNotFoundException fnfe) { System.out.println(fnfe.getMessage()); } } else { try { if (dw != null) dw.close(); if (fw != null) fw.close(); dw = null; fw = null; } catch(IOException ioe) { System.out.println(ioe.getMessage()); } } System.out.println("Data Stream output is now " + dumpBytes); }
|
protected final void toggleDebug () { dumpBytes = !dumpBytes; if (dumpBytes) { try { if (fw == null) { fw = new FileOutputStream("log.txt"); dw = new BufferedOutputStream(fw); } } catch (FileNotFoundException fnfe) { System.out.println(fnfe.getMessage()); } } else { try { if (dw != null) dw.close(); if (fw != null) fw.close(); dw = null; fw = null; } catch(IOException ioe) { System.out.println(ioe.getMessage()); } } System.out.println("Data Stream output is now " + dumpBytes); }
| 5,408
|
public PrinterThread (ScreenChar[] sc, Font font, int cols, int rows, Color colorBg) { setPriority(1); screen = new ScreenChar[sc.length]; int len = sc.length; for (int x = 0; x < len; x++) { screen[x] = new ScreenChar(sc[x].s); screen[x].setCharAndAttr(sc[x].getChar(),sc[x].getCharAttr(),sc[x].isAttributePlace()); } numCols = cols; numRows = rows; this.colorBg = colorBg; this.font = font; }
|
public PrinterThread (ScreenChar[] sc, Font font, int cols, int rows, Color colorBg, Session ses) { setPriority(1); screen = new ScreenChar[sc.length]; int len = sc.length; for (int x = 0; x < len; x++) { screen[x] = new ScreenChar(sc[x].s); screen[x].setCharAndAttr(sc[x].getChar(),sc[x].getCharAttr(),sc[x].isAttributePlace()); } numCols = cols; numRows = rows; this.colorBg = colorBg; this.font = font; }
| 5,409
|
public int print (Graphics g, PageFormat pageFormat, int page) { Graphics2D g2; //--- Validate the page number, we only print the first page if (page == 0) { //--- Create a graphic2D object and set the default parameters g2 = (Graphics2D) g; g2.setColor (colorBg); //--- Translate the origin to be (0,0) g2.translate (pageFormat.getImageableX (), pageFormat.getImageableY ()); int w = (int)pageFormat.getImageableWidth() / numCols; // proposed width int h = (int)pageFormat.getImageableHeight() / numRows; // proposed height Font k = new Font("Courier New",Font.PLAIN,8); LineMetrics l; FontRenderContext f = null; float j = 1; for (; j < 36; j++) { // derive the font and obtain the relevent information to compute // the width and height k = font.deriveFont(j); f = new FontRenderContext(k.getTransform(),true,true); l = k.getLineMetrics("Wy",f); if ( (w < (int)k.getStringBounds("W",f).getWidth() + 1) || h < (int)(k.getStringBounds("g",f).getHeight() + l.getDescent() + l.getLeading()) ) break; } // since we were looking for an overrun of the width or height we need // to adjust the font one down to get the last one that fit. k = font.deriveFont(--j); f = new FontRenderContext(k.getTransform(),true,true); l = k.getLineMetrics("Wy",f); // set the font of the print job g2.setFont(k); // get the width and height of the character bounds int w1 = (int)k.getStringBounds("W",f).getWidth() + 1; int h1 = (int)(k.getStringBounds("g",f).getHeight() + l.getDescent() + l.getLeading()); int x; int y; // loop through all the screen characters and print them out. for (int m = 0;m < numRows; m++) for (int i = 0; i < numCols; i++) { x = w1 * i; y = h1 * m; // only draw printable characters (in this case >= ' ') if (screen[getPos(m,i)].getChar() >= ' ' && !screen[getPos(m,i)].nonDisplay) { g2.drawChars(screen[getPos(m,i)].sChar, 0, 1,x , (int)(y + h1 - (l.getDescent() + l.getLeading())-2)); } // if it is underlined then underline the character if (screen[getPos(m,i)].underLine && !screen[getPos(m,i)].attributePlace) g.drawLine(x, (int)(y + (h1 - l.getLeading()-3)), (int)(x + w1), (int)(y + (h1 - l.getLeading())-3)); } return (PAGE_EXISTS); } else return (NO_SUCH_PAGE); }
|
public int print (Graphics g, PageFormat pageFormat, int page) { Graphics2D g2; //--- Validate the page number, we only print the first page if (page == 0) { //--- Create a graphic2D object and set the default parameters g2 = (Graphics2D) g; g2.setColor (Color.black); //--- Translate the origin to be (0,0) g2.translate (pageFormat.getImageableX (), pageFormat.getImageableY ()); int w = (int)pageFormat.getImageableWidth() / numCols; // proposed width int h = (int)pageFormat.getImageableHeight() / numRows; // proposed height Font k = new Font("Courier New",Font.PLAIN,8); LineMetrics l; FontRenderContext f = null; float j = 1; for (; j < 36; j++) { // derive the font and obtain the relevent information to compute // the width and height k = font.deriveFont(j); f = new FontRenderContext(k.getTransform(),true,true); l = k.getLineMetrics("Wy",f); if ( (w < (int)k.getStringBounds("W",f).getWidth() + 1) || h < (int)(k.getStringBounds("g",f).getHeight() + l.getDescent() + l.getLeading()) ) break; } // since we were looking for an overrun of the width or height we need // to adjust the font one down to get the last one that fit. k = font.deriveFont(--j); f = new FontRenderContext(k.getTransform(),true,true); l = k.getLineMetrics("Wy",f); // set the font of the print job g2.setFont(k); // get the width and height of the character bounds int w1 = (int)k.getStringBounds("W",f).getWidth() + 1; int h1 = (int)(k.getStringBounds("g",f).getHeight() + l.getDescent() + l.getLeading()); int x; int y; // loop through all the screen characters and print them out. for (int m = 0;m < numRows; m++) for (int i = 0; i < numCols; i++) { x = w1 * i; y = h1 * m; // only draw printable characters (in this case >= ' ') if (screen[getPos(m,i)].getChar() >= ' ' && !screen[getPos(m,i)].nonDisplay) { g2.drawChars(screen[getPos(m,i)].sChar, 0, 1,x , (int)(y + h1 - (l.getDescent() + l.getLeading())-2)); } // if it is underlined then underline the character if (screen[getPos(m,i)].underLine && !screen[getPos(m,i)].attributePlace) g.drawLine(x, (int)(y + (h1 - l.getLeading()-3)), (int)(x + w1), (int)(y + (h1 - l.getLeading())-3)); } return (PAGE_EXISTS); } else return (NO_SUCH_PAGE); }
| 5,411
|
public AWTEvent(Object source, int id) { super(source); this.id = id; }
|
public AWTEvent(Event event) { super(source); this.id = id; }
| 5,413
|
public AWTEvent(Object source, int id) { super(source); this.id = id; }
|
public AWTEvent(Object source, int id) { super(source); this.id = id; }
| 5,414
|
My5250 () { splash = new TN5250jSplashScreen(createImageIcon("tn5250jSplash.jpg")); splash.setSteps(4); splash.setVisible(true); focused = createImageIcon("focused.gif"); unfocused = createImageIcon("unfocused.gif"); tnicon = createImageIcon("tnicon.jpg"); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) { } loadSessions(); splash.updateProgress(++step); try { Class.forName("org.tn5250j.scripting.JPythonInterpreterDriver"); } catch (java.lang.NoClassDefFoundError ncdfe) { System.out.println("Information Message: Can not find scripting support" + " files, scripting will not be available: " + "Failed to load interpreter drivers " + ncdfe); } catch (Exception ex) { System.out.println("Information Message: Can not find scripting support" + " files, scripting will not be available: " + "Failed to load interpreter drivers " + ex); } splash.updateProgress(++step); // sets the starting frame type. At this time there are tabs which is // default and Multiple Document Interface. startFrameType(); frames = new Vector(); newView(); setDefaultLocale(); manager = new SessionManager(); manager.setController(this); splash.updateProgress(++step); }
|
My5250 () { splash = new TN5250jSplashScreen(createImageIcon("tn5250jSplash.jpg")); splash.setSteps(4); splash.setVisible(true); focused = createImageIcon("focused.gif"); unfocused = createImageIcon("unfocused.gif"); tnicon = createImageIcon("tnicon.jpg"); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) { } splash.updateProgress(++step); try { Class.forName("org.tn5250j.scripting.JPythonInterpreterDriver"); } catch (java.lang.NoClassDefFoundError ncdfe) { System.out.println("Information Message: Can not find scripting support" + " files, scripting will not be available: " + "Failed to load interpreter drivers " + ncdfe); } catch (Exception ex) { System.out.println("Information Message: Can not find scripting support" + " files, scripting will not be available: " + "Failed to load interpreter drivers " + ex); } splash.updateProgress(++step); // sets the starting frame type. At this time there are tabs which is // default and Multiple Document Interface. startFrameType(); frames = new Vector(); newView(); setDefaultLocale(); manager = new SessionManager(); manager.setController(this); splash.updateProgress(++step); }
| 5,415
|
private String getConnectSession () { Connect sc = new Connect(frame1,LangTool.getString("ss.title"),sessions); // load the new session information from the session property file loadSessions(); return sc.getConnectKey(); }
|
private String getConnectSession () { Connect sc = new Connect(frame1,LangTool.getString("ss.title"),sessions); // load the new session information from the session property file loadDefaultSession(); return sc.getConnectKey(); }
| 5,416
|
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
|
static public void main(String[] args) { initConfig(args); if (sesProps.getProperty(GUI_MDI_TYPE) != null) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
| 5,417
|
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
|
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (sesProps.getProperty(NO_CHECK_RUNNING) != null) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
| 5,418
|
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
|
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (sesProps.getProperty(START_MONITOR_THREAD) != null) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
| 5,419
|
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
|
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
| 5,420
|
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
|
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
| 5,421
|
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
|
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
| 5,422
|
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
|
static public void main(String[] args) { if (isSpecified("-MDI",args)) { useMDIFrames = true; } if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame1.getWidth(); int height = m.frame1.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame1.setSize(width,height); m.frame1.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } m.frame1.setSize(width,height); m.frame1.centerFrame(); // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame1.isVisible()) { m.splash.updateProgress(++m.step); m.frame1.setVisible(true); m.splash.setVisible(false); m.frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
| 5,423
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
|
synchronized void newSession(String sel,String[] args) { String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
| 5,425
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
| 5,426
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (sesProps.getProperty(GUI_NO_TAB) != null) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
| 5,427
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
| 5,428
|
protected void parseArgs(String theStringList, String[] s) { int x = 0; StringTokenizer tokenizer = new StringTokenizer(theStringList, " "); while (tokenizer.hasMoreTokens()) { s[x++] = tokenizer.nextToken(); } }
|
static protected void parseArgs(String theStringList, String[] s) { int x = 0; StringTokenizer tokenizer = new StringTokenizer(theStringList, " "); while (tokenizer.hasMoreTokens()) { s[x++] = tokenizer.nextToken(); } }
| 5,429
|
void startNewSession() { int result = 2; String sel = ""; if (sessionArgs != null && !sessionArgs[0].startsWith("-")) sel = sessionArgs[0]; else { sel = getDefaultSession(); } Sessions sess = manager.getSessions(); if (sel != null && sess.getCount() == 0 && sessions.containsKey(sel)){ sessionArgs = new String[NUM_PARMS]; parseArgs((String)sessions.getProperty(sel), sessionArgs); } if (sessionArgs == null || sess.getCount() > 0 || sessions.containsKey("emul.showConnectDialog")) { sel = getConnectSession(); if (sel != null) { String selArgs = sessions.getProperty(sel); sessionArgs = new String[NUM_PARMS]; parseArgs(selArgs, sessionArgs); newSession(sel,sessionArgs); } else { if (sess.getCount() == 0) System.exit(0); } } else { newSession(sel,sessionArgs); } }
|
void startNewSession() { int result = 2; String sel = ""; if (sessionArgs != null && !sessionArgs[0].startsWith("-")) sel = sessionArgs[0]; else { sel = getDefaultSession(); } Sessions sess = manager.getSessions(); if (sel != null && sess.getCount() == 0 && sessions.containsKey(sel)){ sessionArgs = new String[NUM_PARMS]; parseArgs((String)sessions.getProperty(sel), sessionArgs); } if (sessionArgs == null || sess.getCount() > 0 || sessions.containsKey("emul.showConnectDialog")) { sel = getConnectSession(); if (sel != null) { String selArgs = sessions.getProperty(sel); sessionArgs = new String[NUM_PARMS]; parseArgs(selArgs, sessionArgs); newSession(sel,sessionArgs); } else { if (sess.getCount() == 0) System.exit(0); } } else { newSession(sel,sessionArgs); } }
| 5,430
|
void startNewSession() { int result = 2; String sel = ""; if (sessionArgs != null && !sessionArgs[0].startsWith("-")) sel = sessionArgs[0]; else { sel = getDefaultSession(); } Sessions sess = manager.getSessions(); if (sel != null && sess.getCount() == 0 && sessions.containsKey(sel)){ sessionArgs = new String[NUM_PARMS]; parseArgs((String)sessions.getProperty(sel), sessionArgs); } if (sessionArgs == null || sess.getCount() > 0 || sessions.containsKey("emul.showConnectDialog")) { sel = getConnectSession(); if (sel != null) { String selArgs = sessions.getProperty(sel); sessionArgs = new String[NUM_PARMS]; parseArgs(selArgs, sessionArgs); newSession(sel,sessionArgs); } else { if (sess.getCount() == 0) System.exit(0); } } else { newSession(sel,sessionArgs); } }
|
void startNewSession() { int result = 2; String sel = ""; if (sessionArgs != null && !sessionArgs[0].startsWith("-")) sel = sessionArgs[0]; else { sel = getDefaultSession(); } Sessions sess = manager.getSessions(); if (sel != null && sess.getCount() == 0 && sessions.containsKey(sel)){ sessionArgs = new String[NUM_PARMS]; parseArgs((String)sessions.getProperty(sel), sessionArgs); } if (sessionArgs == null || sess.getCount() > 0 || sessions.containsKey("emul.showConnectDialog")) { sel = getConnectSession(); if (sel != null) { String selArgs = sessions.getProperty(sel); sessionArgs = new String[NUM_PARMS]; parseArgs(selArgs, sessionArgs); newSession(sel,sessionArgs); } else { if (sess.getCount() == 0) System.exit(0); } } else { newSession(sel,sessionArgs); } }
| 5,431
|
void startNewSession() { int result = 2; String sel = ""; if (sessionArgs != null && !sessionArgs[0].startsWith("-")) sel = sessionArgs[0]; else { sel = getDefaultSession(); } Sessions sess = manager.getSessions(); if (sel != null && sess.getCount() == 0 && sessions.containsKey(sel)){ sessionArgs = new String[NUM_PARMS]; parseArgs((String)sessions.getProperty(sel), sessionArgs); } if (sessionArgs == null || sess.getCount() > 0 || sessions.containsKey("emul.showConnectDialog")) { sel = getConnectSession(); if (sel != null) { String selArgs = sessions.getProperty(sel); sessionArgs = new String[NUM_PARMS]; parseArgs(selArgs, sessionArgs); newSession(sel,sessionArgs); } else { if (sess.getCount() == 0) System.exit(0); } } else { newSession(sel,sessionArgs); } }
|
void startNewSession() { int result = 2; String sel = ""; if (sessionArgs != null && !sessionArgs[0].startsWith("-")) sel = sessionArgs[0]; else { sel = getDefaultSession(); } Sessions sess = manager.getSessions(); if (sel != null && sess.getCount() == 0 && sessions.containsKey(sel)){ sessionArgs = new String[NUM_PARMS]; parseArgs((String)sessions.getProperty(sel), sessionArgs); } if (sessionArgs == null || sess.getCount() > 0 || sessions.containsKey("emul.showConnectDialog")) { sel = getConnectSession(); if (sel != null) { String selArgs = sessions.getProperty(sel); sessionArgs = new String[NUM_PARMS]; parseArgs(selArgs, sessionArgs); newSession(sesProps.getProperty(SESSION_HOST), null); } else { if (sess.getCount() == 0) System.exit(0); } } else { newSession(sesProps.getProperty(SESSION_HOST), null); } }
| 5,432
|
public void setEnabled(boolean e) { // if this call does not represent a CHANGE in state, then return if ((e && isEnabled()) || (!e && !isEnabled())) return; // make the change if (e) stateMask = stateMask | ENABLED; else stateMask = stateMask & (~ENABLED); // notify interested ChangeListeners fireStateChanged(); }
|
public void setEnabled(boolean e) { // if this call does not represent a CHANGE in state, then return if ((e && isEnabled()) || (!e && !isEnabled())) return; // make the change if (e) stateMask = stateMask | ENABLED; else stateMask = stateMask & (~ENABLED) & (~ARMED) & (~PRESSED); // notify interested ChangeListeners fireStateChanged(); }
| 5,433
|
public void setGroup(ButtonGroup g) { if (group != g) { group = g; fireStateChanged(); } }
|
public void setGroup(ButtonGroup g) { if (group != g) { group = g; fireStateChanged(); } }
| 5,434
|
public void setGroup(ButtonGroup g) { if (group != g) { group = g; fireStateChanged(); } }
|
public void setGroup(ButtonGroup g) { if (group != g) { group = g; fireStateChanged(); } }
| 5,435
|
public void setRxMode(int rxMode) { this.rxMode = rxMode; }
|
public void setRxMode(int rxMode) { this.rxMode = rxMode; }
| 5,436
|
private void getPCFile() { String workingDir = System.getProperty("user.dir"); MyFileChooser pcFileChooser = new MyFileChooser(workingDir); int ret = pcFileChooser.showSaveDialog(new JFrame()); // check to see if something was actually chosen if (ret == JFileChooser.APPROVE_OPTION) { File file = pcFileChooser.getSelectedFile(); StringBuffer sb = new StringBuffer(); char[] s = screen.getScreenAsChars(); int c = screen.getCols(); int l = screen.getRows() * c; int col = 0; for (int x = 0; x < l; x++,col++) { sb.append(s[x]); if (col == c) { sb.append('\n'); col = 0; } } writeToFile(sb.toString(),file); } }
|
private void getPCFile() { String workingDir = System.getProperty("user.dir"); TN5250jFileChooser pcFileChooser = new TN5250jFileChooser(workingDir); int ret = pcFileChooser.showSaveDialog(new JFrame()); // check to see if something was actually chosen if (ret == JFileChooser.APPROVE_OPTION) { File file = pcFileChooser.getSelectedFile(); StringBuffer sb = new StringBuffer(); char[] s = screen.getScreenAsChars(); int c = screen.getCols(); int l = screen.getRows() * c; int col = 0; for (int x = 0; x < l; x++,col++) { sb.append(s[x]); if (col == c) { sb.append('\n'); col = 0; } } writeToFile(sb.toString(),file); } }
| 5,437
|
public AccessibleRole getAccessibleRole() { return AccessibleRole.POPUP_MENU; }
|
public AccessibleRole getAccessibleRole() { return AccessibleRole.COMBO_BOX; }
| 5,438
|
protected void calculateThumbLocation() { int value = slider.getValue(); if (slider.getOrientation() == JSlider.HORIZONTAL) { thumbRect.x = xPositionForValue(value) - thumbRect.width / 2; thumbRect.y = contentRect.y; } else { thumbRect.x = contentRect.x; thumbRect.y = yPositionForValue(value) - thumbRect.height / 2; } }
|
protected void calculateThumbLocation() { int value = slider.getValue(); if (slider.getOrientation() == JSlider.HORIZONTAL) { thumbRect.x = xPositionForValue(value) - thumbRect.width / 2; thumbRect.y = trackRect.y; } else { thumbRect.x = contentRect.x; thumbRect.y = yPositionForValue(value) - thumbRect.height / 2; } }
| 5,439
|
protected void calculateThumbLocation() { int value = slider.getValue(); if (slider.getOrientation() == JSlider.HORIZONTAL) { thumbRect.x = xPositionForValue(value) - thumbRect.width / 2; thumbRect.y = contentRect.y; } else { thumbRect.x = contentRect.x; thumbRect.y = yPositionForValue(value) - thumbRect.height / 2; } }
|
protected void calculateThumbLocation() { int value = slider.getValue(); if (slider.getOrientation() == JSlider.HORIZONTAL) { thumbRect.x = xPositionForValue(value) - thumbRect.width / 2; thumbRect.y = contentRect.y; } else { thumbRect.x = trackRect.x; thumbRect.y = yPositionForValue(value) - thumbRect.height / 2; } }
| 5,440
|
protected void calculateThumbSize() { if (slider.getOrientation() == JSlider.HORIZONTAL) { if (thumbWidth > contentRect.width) thumbRect.width = contentRect.width / 4; else thumbRect.width = thumbWidth; if (thumbHeight > contentRect.height) thumbRect.height = contentRect.height; else thumbRect.height = thumbHeight; } else { // The thumb gets flipped when inverted, so thumbWidth // actually is the height and vice versa. if (thumbWidth > contentRect.height) thumbRect.height = contentRect.height / 4; else thumbRect.height = thumbWidth; if (thumbHeight > contentRect.width) thumbRect.width = contentRect.width; else thumbRect.width = thumbHeight; } }
|
protected void calculateThumbSize() { if (slider.getOrientation() == JSlider.HORIZONTAL) { if (thumbWidth > contentRect.width) thumbRect.width = contentRect.width / 4; else thumbRect.width = thumbWidth; if (thumbHeight > contentRect.height) thumbRect.height = contentRect.height; else thumbRect.height = thumbHeight; } else { // The thumb gets flipped when inverted, so thumbWidth // actually is the height and vice versa. if (thumbWidth > contentRect.height) thumbRect.height = contentRect.height / 4; else thumbRect.height = thumbWidth; if (thumbHeight > contentRect.width) thumbRect.width = contentRect.width; else thumbRect.width = thumbHeight; } }
| 5,441
|
protected void calculateThumbSize() { if (slider.getOrientation() == JSlider.HORIZONTAL) { if (thumbWidth > contentRect.width) thumbRect.width = contentRect.width / 4; else thumbRect.width = thumbWidth; if (thumbHeight > contentRect.height) thumbRect.height = contentRect.height; else thumbRect.height = thumbHeight; } else { // The thumb gets flipped when inverted, so thumbWidth // actually is the height and vice versa. if (thumbWidth > contentRect.height) thumbRect.height = contentRect.height / 4; else thumbRect.height = thumbWidth; if (thumbHeight > contentRect.width) thumbRect.width = contentRect.width; else thumbRect.width = thumbHeight; } }
|
protected void calculateThumbSize() { if (slider.getOrientation() == JSlider.HORIZONTAL) { if (thumbWidth > contentRect.width) thumbRect.width = contentRect.width / 4; else thumbRect.width = thumbWidth; if (thumbHeight > contentRect.height) thumbRect.height = contentRect.height; else thumbRect.height = thumbHeight; } else { // The thumb gets flipped when inverted, so thumbWidth // actually is the height and vice versa. if (thumbWidth > contentRect.height) thumbRect.height = contentRect.height / 4; else thumbRect.height = thumbWidth; if (thumbHeight > contentRect.width) thumbRect.width = contentRect.width; else thumbRect.width = thumbHeight; } }
| 5,442
|
protected void calculateTrackBuffer() { if (slider.getOrientation() == JSlider.HORIZONTAL) trackBuffer = thumbRect.width; else trackBuffer = thumbRect.height; }
|
protected void calculateTrackBuffer() { if (slider.getOrientation() == JSlider.HORIZONTAL) trackBuffer = thumbRect.width / 2; else trackBuffer = thumbRect.height; }
| 5,443
|
protected void calculateTrackBuffer() { if (slider.getOrientation() == JSlider.HORIZONTAL) trackBuffer = thumbRect.width; else trackBuffer = thumbRect.height; }
|
protected void calculateTrackBuffer() { if (slider.getOrientation() == JSlider.HORIZONTAL) trackBuffer = thumbRect.width; else trackBuffer = thumbRect.height / 2; }
| 5,444
|
protected void calculateTrackRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { trackRect.x = contentRect.x + trackBuffer; trackRect.y = contentRect.y; trackRect.width = contentRect.width - 2 * trackBuffer; trackRect.height = thumbRect.height; } else { trackRect.x = contentRect.x; trackRect.y = contentRect.y + trackBuffer; trackRect.width = thumbRect.width; trackRect.height = contentRect.height - 2 * trackBuffer; } }
|
protected void calculateTrackRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { trackRect.x = contentRect.x + trackBuffer; int h = getThumbSize().height; if (slider.getPaintTicks() && (slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0)) h += getTickLength(); trackRect.y = contentRect.y + (contentRect.height - h) / 2 - 1; trackRect.width = contentRect.width - 2 * trackBuffer; trackRect.height = thumbRect.height; } else { trackRect.x = contentRect.x; trackRect.y = contentRect.y + trackBuffer; trackRect.width = thumbRect.width; trackRect.height = contentRect.height - 2 * trackBuffer; } }
| 5,445
|
protected void calculateTrackRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { trackRect.x = contentRect.x + trackBuffer; trackRect.y = contentRect.y; trackRect.width = contentRect.width - 2 * trackBuffer; trackRect.height = thumbRect.height; } else { trackRect.x = contentRect.x; trackRect.y = contentRect.y + trackBuffer; trackRect.width = thumbRect.width; trackRect.height = contentRect.height - 2 * trackBuffer; } }
|
protected void calculateTrackRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { trackRect.x = contentRect.x + trackBuffer; trackRect.y = contentRect.y; trackRect.width = contentRect.width - 2 * trackBuffer; trackRect.height = thumbRect.height; } else { int w = getThumbSize().width; if (slider.getPaintTicks() && (slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0)) w += getTickLength(); trackRect.x = contentRect.x + (contentRect.width - w) / 2 - 1; trackRect.y = contentRect.y + trackBuffer; trackRect.width = thumbRect.width; trackRect.height = contentRect.height - 2 * trackBuffer; } }
| 5,446
|
public Dimension getMaximumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) return getPreferredHorizontalSize(); else return getPreferredVerticalSize(); }
|
public Dimension getMaximumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) { int height = getThumbSize().height; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) height += getTickLength(); if (slider.getPaintLabels()) height += getHeightOfTallestLabel(); height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; return new Dimension(32767, height); } else return getPreferredVerticalSize(); }
| 5,447
|
public Dimension getMaximumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) return getPreferredHorizontalSize(); else return getPreferredVerticalSize(); }
|
public Dimension getMaximumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) return getPreferredHorizontalSize(); else { int width = getThumbSize().width; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) width += getTickLength(); if (slider.getPaintLabels()) width += getWidthOfWidestLabel(); width += insets.left + insets.right + focusInsets.left + focusInsets.right; return new Dimension(width, 32767); } }
| 5,448
|
public Dimension getMinimumHorizontalSize() { return getPreferredHorizontalSize(); }
|
public Dimension getMinimumHorizontalSize() { Insets insets = slider.getInsets(); int height = getThumbSize().height; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) height += getTickLength(); if (slider.getPaintLabels()) height += getHeightOfTallestLabel(); height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; return new Dimension(36, height); }
| 5,449
|
public Dimension getMinimumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) return getPreferredHorizontalSize(); else return getPreferredVerticalSize(); }
|
public Dimension getMinimumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) return getMinimumHorizontalSize(); else return getPreferredVerticalSize(); }
| 5,450
|
public Dimension getMinimumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) return getPreferredHorizontalSize(); else return getPreferredVerticalSize(); }
|
public Dimension getMinimumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) return getPreferredHorizontalSize(); else return getMinimumVerticalSize(); }
| 5,451
|
public Dimension getMinimumVerticalSize() { return getPreferredVerticalSize(); }
|
public Dimension getMinimumVerticalSize() { Insets insets = slider.getInsets(); int width = getThumbSize().width; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) width += getTickLength(); if (slider.getPaintLabels()) width += getWidthOfWidestLabel(); width += insets.left + insets.right + focusInsets.left + focusInsets.right; return new Dimension(width, 36); }
| 5,452
|
public Dimension getPreferredHorizontalSize() { Insets insets = slider.getInsets(); // The width should cover all the labels (which are usually the // deciding factor of the width) int width = getWidthOfWidestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); // If there are not enough labels. // This number is pretty much arbitrary, but it looks nice. if (width < 200) width = 200; // We can only draw inside of the focusRectangle, so we have to // pad it with insets. width += insets.left + insets.right + focusInsets.left + focusInsets.right; // Height is determined by the thumb, the ticks and the labels. int height = thumbHeight; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) height += tickHeight; if (slider.getPaintLabels()) height += getHeightOfTallestLabel(); height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; return new Dimension(width, height); }
|
public Dimension getPreferredHorizontalSize() { Insets insets = slider.getInsets(); // The width should cover all the labels (which are usually the // deciding factor of the width) int width = getWidthOfWidestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); // If there are not enough labels. // This number is pretty much arbitrary, but it looks nice. if (width < 200) width = 200; // We can only draw inside of the focusRectangle, so we have to // pad it with insets. width += insets.left + insets.right + focusInsets.left + focusInsets.right; // Height is determined by the thumb, the ticks and the labels. int height = getThumbSize().height; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) height += tickHeight; if (slider.getPaintLabels()) height += getHeightOfTallestLabel(); height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; return new Dimension(width, height); }
| 5,453
|
public Dimension getPreferredHorizontalSize() { Insets insets = slider.getInsets(); // The width should cover all the labels (which are usually the // deciding factor of the width) int width = getWidthOfWidestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); // If there are not enough labels. // This number is pretty much arbitrary, but it looks nice. if (width < 200) width = 200; // We can only draw inside of the focusRectangle, so we have to // pad it with insets. width += insets.left + insets.right + focusInsets.left + focusInsets.right; // Height is determined by the thumb, the ticks and the labels. int height = thumbHeight; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) height += tickHeight; if (slider.getPaintLabels()) height += getHeightOfTallestLabel(); height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; return new Dimension(width, height); }
|
public Dimension getPreferredHorizontalSize() { Insets insets = slider.getInsets(); // The width should cover all the labels (which are usually the // deciding factor of the width) int width = getWidthOfWidestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); // If there are not enough labels. // This number is pretty much arbitrary, but it looks nice. if (width < 200) width = 200; // We can only draw inside of the focusRectangle, so we have to // pad it with insets. width += insets.left + insets.right + focusInsets.left + focusInsets.right; // Height is determined by the thumb, the ticks and the labels. int height = thumbHeight; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) height += getTickLength(); if (slider.getPaintLabels()) height += getHeightOfTallestLabel(); height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; return new Dimension(width, height); }
| 5,454
|
public Dimension getPreferredVerticalSize() { Insets insets = slider.getInsets(); int height = getHeightOfTallestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); if (height < 200) height = 200; height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; int width = thumbHeight; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) width += tickHeight; if (slider.getPaintLabels()) width += getWidthOfWidestLabel(); width += insets.left + insets.right + focusInsets.left + focusInsets.right; return new Dimension(width, height); }
|
public Dimension getPreferredVerticalSize() { Insets insets = slider.getInsets(); int height = getHeightOfTallestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); if (height < 200) height = 200; height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; int width = getThumbSize().width; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) width += tickHeight; if (slider.getPaintLabels()) width += getWidthOfWidestLabel(); width += insets.left + insets.right + focusInsets.left + focusInsets.right; return new Dimension(width, height); }
| 5,455
|
public Dimension getPreferredVerticalSize() { Insets insets = slider.getInsets(); int height = getHeightOfTallestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); if (height < 200) height = 200; height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; int width = thumbHeight; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) width += tickHeight; if (slider.getPaintLabels()) width += getWidthOfWidestLabel(); width += insets.left + insets.right + focusInsets.left + focusInsets.right; return new Dimension(width, height); }
|
public Dimension getPreferredVerticalSize() { Insets insets = slider.getInsets(); int height = getHeightOfTallestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); if (height < 200) height = 200; height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; int width = thumbHeight; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) width += getTickLength(); if (slider.getPaintLabels()) width += getWidthOfWidestLabel(); width += insets.left + insets.right + focusInsets.left + focusInsets.right; return new Dimension(width, height); }
| 5,456
|
protected Dimension getThumbSize() { // This is really just the bounds box for the thumb. // The thumb will actually be pointed (like a rectangle + triangle at bottom) return thumbRect.getSize(); }
|
protected Dimension getThumbSize() { // This is really just the bounds box for the thumb. // The thumb will actually be pointed (like a rectangle + triangle at bottom) if (slider.getOrientation() == JSlider.HORIZONTAL) return new Dimension(11, 20); else return new Dimension(20, 11); }
| 5,457
|
protected int getTickLength() { return tickHeight; }
|
protected int getTickLength() { return 8; }
| 5,458
|
protected void installDefaults(JSlider slider) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); slider.setForeground(defaults.getColor("Slider.foreground")); slider.setBackground(defaults.getColor("Slider.background")); shadowColor = defaults.getColor("Slider.shadow"); highlightColor = defaults.getColor("Slider.highlight"); focusColor = defaults.getColor("Slider.focus"); slider.setBorder(defaults.getBorder("Slider.border")); slider.setOpaque(true); thumbHeight = defaults.getInt("Slider.thumbHeight"); thumbWidth = defaults.getInt("Slider.thumbWidth"); tickHeight = defaults.getInt("Slider.tickHeight"); focusInsets = defaults.getInsets("Slider.focusInsets"); }
|
protected void installDefaults(JSlider slider) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); slider.setForeground(defaults.getColor("Slider.foreground")); slider.setBackground(defaults.getColor("Slider.background")); shadowColor = defaults.getColor("Slider.shadow"); highlightColor = defaults.getColor("Slider.highlight"); focusColor = defaults.getColor("Slider.focus"); slider.setBorder(defaults.getBorder("Slider.border")); slider.setOpaque(true); thumbHeight = defaults.getInt("Slider.thumbHeight"); thumbWidth = defaults.getInt("Slider.thumbWidth"); tickHeight = defaults.getInt("Slider.tickHeight"); focusInsets = defaults.getInsets("Slider.focusInsets"); }
| 5,459
|
protected void paintMajorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x) { int y = tickRect.y + tickRect.height / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x, y + tickRect.height / 2); g.setColor(saved); }
|
protected void paintMajorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x) { int y = tickRect.height / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x, y + tickRect.height / 2); g.setColor(saved); }
| 5,460
|
protected void paintMajorTickForVertSlider(Graphics g, Rectangle tickBounds, int y) { int x = tickRect.x + tickRect.width / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x + tickRect.width / 2, y); g.setColor(saved); }
|
protected void paintMajorTickForVertSlider(Graphics g, Rectangle tickBounds, int y) { int x = tickRect.width / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x + tickRect.width / 2, y); g.setColor(saved); }
| 5,461
|
protected void paintMinorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x) { int y = tickRect.y + tickRect.height / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x, y + tickRect.height / 4); g.setColor(saved); }
|
protected void paintMinorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x) { int y = tickRect.height / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x, y + tickRect.height / 4); g.setColor(saved); }
| 5,462
|
protected void paintMinorTickForVertSlider(Graphics g, Rectangle tickBounds, int y) { int x = tickRect.x + tickRect.width / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x + tickRect.width / 4, y); g.setColor(saved); }
|
protected void paintMinorTickForVertSlider(Graphics g, Rectangle tickBounds, int y) { int x = tickRect.width / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x + tickRect.width / 4, y); g.setColor(saved); }
| 5,463
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 5,464
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon light; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 5,465
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 5,466
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x - 1, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 5,467
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 5,468
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4 - 1; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 5,469
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 5,470
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 5,471
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 5,472
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 5,473
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x + 0.5; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x + 0.5; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 5,475
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 5,476
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y + 0.5; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y + 0.5; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 5,477
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 5,478
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y + 0.5; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y + 0.5; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 5,479
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.