rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
getColumnModel().getSelectionModel().clearSelection();
public void clearSelection() { selectionModel.clearSelection(); }
else if (vc > getColumnCount()) return -1;
public int convertColumnIndexToModel(int vc) { if (vc < 0) return vc; else if (vc > getColumnCount()) return -1; else return columnModel.getColumn(vc).getModelIndex(); }
return dataModel.getColumnName(column);
int modelColumn = columnModel.getColumn(column).getModelIndex(); return dataModel.getColumnName(modelColumn);
public String getColumnName(int column) { return dataModel.getColumnName(column); }
if (! rowSelectionAllowed) return null;
public ListSelectionModel getSelectionModel() { if (! rowSelectionAllowed) return null; return selectionModel; }
this.dragEnabled = false;
this.dragEnabled = true;
protected void initializeLocalVars() { setTableHeader(createDefaultTableHeader()); this.autoCreateColumnsFromModel = false; if (columnModel == null) { this.autoCreateColumnsFromModel = true; createColumnsFromModel(); } this.columnModel.addColumnModelListener(this); this.defaultRenderersByColumnClass = new Hashtable(); createDefaultRenderers(); this.defaultEditorsByColumnClass = new Hashtable(); createDefaultEditors(); this.autoResizeMode = AUTO_RESIZE_ALL_COLUMNS; this.rowHeight = 16; this.rowMargin = 1; this.rowSelectionAllowed = true; // this.accessibleContext = new AccessibleJTable(); this.cellEditor = null; this.dragEnabled = false; this.preferredViewportSize = new Dimension(450,400); this.showHorizontalLines = true; this.showVerticalLines = true; this.editingColumn = -1; this.editingRow = -1; setIntercellSpacing(new Dimension(1,1)); }
public void setAutoCreateColumnsFromModel(boolean a)
public void setAutoCreateColumnsFromModel(boolean autoCreate)
public void setAutoCreateColumnsFromModel(boolean a) { autoCreateColumnsFromModel = a; }
autoCreateColumnsFromModel = a;
if (autoCreateColumnsFromModel != autoCreate) { autoCreateColumnsFromModel = autoCreate; if (autoCreate) createDefaultColumnsFromModel(); }
public void setAutoCreateColumnsFromModel(boolean a) { autoCreateColumnsFromModel = a; }
*/ if (attrib != null) { value = attrib.getAttribValue().toString(); }
public String getAttributeStringValue(String attribName) { String value = null; Attribute attrib = getAttribute(attribName); if (attrib != null && attrib.getAttribType() == Constants.STRING_TYPE) { value = (String) attrib.getAttribValue(); } return value; }
throw new BAD_OPERATION("Invalid enumeration code " + code);
BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); bad.minor = Minor.PolicyType; throw bad;
public static ThreadPolicyValue from_int(int code) { try { return enume [ code ]; } catch (ArrayIndexOutOfBoundsException ex) { throw new BAD_OPERATION("Invalid enumeration code " + code); } }
public Object run() { return System.getProperty(key, defaultValue); }
public Object run() { return System.getProperty(name, value); }
public Object run() { return System.getProperty(key, defaultValue); }
public Token readToken()
Token readToken()
public Token readToken() throws IOException { Token token = null; int c = in.read(); switch(c) { case -1: token = new Token(Token.EOF); break; case '{': token = new Token(Token.LCURLY); break; case '}': token = new Token(Token.RCURLY); break; case '\\': buffer.delete(0, buffer.length()); buffer.append((char) c); token = readControlWord(); break; default: buffer.delete(0, buffer.length()); buffer.append((char) c); token = readText(); break; } return token; }
Token token = null; int c = in.read(); switch(c)
Token token; if (lastToken != null)
public Token readToken() throws IOException { Token token = null; int c = in.read(); switch(c) { case -1: token = new Token(Token.EOF); break; case '{': token = new Token(Token.LCURLY); break; case '}': token = new Token(Token.RCURLY); break; case '\\': buffer.delete(0, buffer.length()); buffer.append((char) c); token = readControlWord(); break; default: buffer.delete(0, buffer.length()); buffer.append((char) c); token = readText(); break; } return token; }
case -1: token = new Token(Token.EOF); break; case '{': token = new Token(Token.LCURLY); break; case '}': token = new Token(Token.RCURLY); break; case '\\': buffer.delete(0, buffer.length()); buffer.append((char) c); token = readControlWord(); break; default: buffer.delete(0, buffer.length()); buffer.append((char) c); token = readText(); break;
token = lastToken; lastToken = null;
public Token readToken() throws IOException { Token token = null; int c = in.read(); switch(c) { case -1: token = new Token(Token.EOF); break; case '{': token = new Token(Token.LCURLY); break; case '}': token = new Token(Token.RCURLY); break; case '\\': buffer.delete(0, buffer.length()); buffer.append((char) c); token = readControlWord(); break; default: buffer.delete(0, buffer.length()); buffer.append((char) c); token = readText(); break; } return token; }
else token = readTokenImpl();
public Token readToken() throws IOException { Token token = null; int c = in.read(); switch(c) { case -1: token = new Token(Token.EOF); break; case '{': token = new Token(Token.LCURLY); break; case '}': token = new Token(Token.RCURLY); break; case '\\': buffer.delete(0, buffer.length()); buffer.append((char) c); token = readControlWord(); break; default: buffer.delete(0, buffer.length()); buffer.append((char) c); token = readText(); break; } return token; }
attributes = s;
AttributeContext ctx = getAttributeContext(); attributes = ctx.getEmptySet(); if (s != null) attributes = ctx.addAttributes(attributes, s);
public AbstractElement(Element p, AttributeSet s) { element_parent = p; attributes = s; }
return attributes;
return this;
public AttributeSet getAttributes() { return attributes; }
this.start = start; this.end = end;
try { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } catch (BadLocationException ex) { throw new AssertionError("BadLocationException must not be thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); }
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); this.start = start; this.end = end; }
return end;
return endPos.getOffset();
public int getEndOffset() { return end; }
return start;
return startPos.getOffset();
public int getStartOffset() { return start; }
if (offset < 0 || offset > getLength()) throw new BadLocationException(getText(0, getLength()), offset); return new Position() { public int getOffset() { return offset; } };
return content.createPosition(offset);
public Position createPosition(final int offset) throws BadLocationException { if (offset < 0 || offset > getLength()) throw new BadLocationException(getText(0, getLength()), offset); return new Position() { public int getOffset() { return offset; } }; }
public int getOffset() { return offset; }
public int getOffset() { return getLength(); }
public int getOffset() { return offset; }
return getLength();
return 0;
public int getOffset() { return getLength(); }
public void render(Runnable r)
public void render(Runnable runnable)
public void render(Runnable r) { }
public void setDocumentProperties(Dictionary x)
public void setDocumentProperties(Dictionary p)
public void setDocumentProperties(Dictionary x) { // FIXME: make me thread-safe properties = x; }
properties = x;
properties = p;
public void setDocumentProperties(Dictionary x) { // FIXME: make me thread-safe properties = x; }
popup.hide();
public void focusLost(FocusEvent e) { hasFocus = false; comboBox.repaint(); popup.hide(); }
} else popup = new Popup.JWindowPopup(owner, contents, x, y);
public Popup getPopup(Component owner, Component contents, int x, int y) { Popup popup = null; // By default we enable lightweight popups since they are more efficient // than heavyweight popups. boolean lightweightEnabled = true; // Special case JPopupMenu here, since it supports a lightweightEnabled // flag that we must respect. if (contents instanceof JPopupMenu) { JPopupMenu menu = (JPopupMenu) contents; lightweightEnabled = menu.isLightWeightPopupEnabled(); } // If we have a root pane and the contents fits within the root pane and // lightweight popups are enabled, than we can use a lightweight popup. JRootPane root = SwingUtilities.getRootPane(owner); Point rootLoc = root.getLocationOnScreen(); Dimension contentsSize = contents.getSize(); Dimension rootSize = root.getSize(); if (x >= rootLoc.x && y > rootLoc.y && (x - rootLoc.x) + contentsSize.width < rootSize.width && (y - rootLoc.y) + contentsSize.height < rootSize.height) popup = new Popup.LightweightPopup(owner, contents, x, y); else popup = new Popup.JWindowPopup(owner, contents, x, y); return popup; }
scrollbar.repaint();
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("model")) { ((BoundedRangeModel) e.getOldValue()).removeChangeListener(modelListener); scrollbar.getModel().addChangeListener(modelListener); getThumbBounds(); } else if (e.getPropertyName().equals("orientation")) { incrButton.removeMouseListener(buttonListener); decrButton.removeMouseListener(buttonListener); int orientation = scrollbar.getOrientation(); switch (orientation) { case (JScrollBar.HORIZONTAL): incrButton = createIncreaseButton(EAST); decrButton = createDecreaseButton(WEST); break; default: incrButton = createIncreaseButton(SOUTH); decrButton = createDecreaseButton(NORTH); break; } incrButton.addMouseListener(buttonListener); decrButton.addMouseListener(buttonListener); calculatePreferredSize(); } scrollbar.repaint(); }
EntityDeclaration declaration);
String replacementText);
public abstract EntityReference createEntityReference(String name, EntityDeclaration declaration);
public EntryRecord(byte[] buff) { this.buff = buff; }
public EntryRecord(ISO9660Volume volume, byte[] buff, int offset, String encoding) { this.volume = volume; this.encoding = encoding; this.entryLength = LittleEndian.getUInt8(buff, offset+0); this.extAttributeLength = LittleEndian.getUInt8(buff, offset+1); this.extentLocation = LittleEndian.getUInt32(buff, offset+2); this.dataLength = (int)LittleEndian.getUInt32(buff, offset+10); this.fileUnitSize = LittleEndian.getUInt8(buff, offset+26); this.interleaveSize = LittleEndian.getUInt8(buff, offset+27); this.flags = LittleEndian.getUInt8(buff, offset + 25); this.identifier = getFileIdentifier(buff, offset, isDirectory(), encoding); }
public EntryRecord(byte[] buff) { this.buff = buff; }
public int getDataLength() { return (int)LittleEndian.getUInt32(buff,10); }
public int getDataLength() { return dataLength; }
public int getDataLength() { return (int)LittleEndian.getUInt32(buff,10); }
public String getFileIdentifier() { if(this.isDirectory()) { if(this.getLengthOfFileIdentifier() == 1 && buff[33]== 0x00) return "."; if(this.getLengthOfFileIdentifier() == 1 && buff[33]== 0x01) return ".."; return new String(buff, 33 , this.getLengthOfFileIdentifier()); } return new String(buff, 33 , this.getLengthOfFileIdentifier() - 2); }
public String getFileIdentifier() { return identifier; }
public String getFileIdentifier() { if(this.isDirectory()) { if(this.getLengthOfFileIdentifier() == 1 && buff[33]== 0x00) return "."; if(this.getLengthOfFileIdentifier() == 1 && buff[33]== 0x01) return ".."; return new String(buff, 33 , this.getLengthOfFileIdentifier()); } return new String(buff, 33 , this.getLengthOfFileIdentifier() - 2); }
public int getFileUnitSize() { return buff[26]; }
public final int getFileUnitSize() { return fileUnitSize; }
public int getFileUnitSize() { return buff[26]; }
public int getFlags() { return buff[25]; }
public final int getFlags() { return flags; }
public int getFlags() { return buff[25]; }
public int getInterleaveSize() { return buff[27]; }
public final int getInterleaveSize() { return interleaveSize; }
public int getInterleaveSize() { return buff[27]; }
public int getLengthOfDirectoryEntry() { return LittleEndian.getUInt8(buff, 0); }
public int getLengthOfDirectoryEntry() { return entryLength; }
public int getLengthOfDirectoryEntry() { return LittleEndian.getUInt8(buff, 0); }
public int getLengthOfExtendedAttribute() { return buff[1]; }
public int getLengthOfExtendedAttribute() { return extAttributeLength; }
public int getLengthOfExtendedAttribute() { return buff[1]; }
public int getLocationOfExtent() { return (int)LittleEndian.getUInt32(buff,2); }
public long getLocationOfExtent() { return extentLocation; }
public int getLocationOfExtent() { return (int)LittleEndian.getUInt32(buff,2); }
public ISO9660Volume getVolume() { return volume; }
public final ISO9660Volume getVolume() { return volume; }
public ISO9660Volume getVolume() { return volume; }
public boolean isDirectory() { return (buff[25] & 0x03) != 0; }
public final boolean isDirectory() { return (flags & 0x03) != 0; }
public boolean isDirectory() { return (buff[25] & 0x03) != 0; }
public boolean isLastEntry() { return (buff[25] & 0x40) == 0; }
public final boolean isLastEntry() { return (flags & 0x40) == 0; }
public boolean isLastEntry() { return (buff[25] & 0x40) == 0; }
VmStackFrame(Address src, VmStackReader reader, Address ip) { this.sfMethod = reader.getMethod(src); this.sfCompiledCode = reader.getCompiledCode(src); this.sfReturnAddress = reader.getReturnAddress(src); this.sfInstructionPointer = ip;
VmStackFrame(VmMethod method, int programCounter) { this.sfMethod = method; this.programCounter = programCounter;
VmStackFrame(Address src, VmStackReader reader, Address ip) { this.sfMethod = reader.getMethod(src); this.sfCompiledCode = reader.getCompiledCode(src); this.sfReturnAddress = reader.getReturnAddress(src); this.sfInstructionPointer = ip; }
final VmCompiledCode cc = sfCompiledCode; if ((cc != null) && (sfInstructionPointer != null)) { return cc.getLocationInfo(sfMethod, sfInstructionPointer); } else { return "?"; }
int lineNo = -1; if (sfMethod != null) { final VmByteCode bc = sfMethod.getBytecode(); if (bc != null) { lineNo = bc.getLineNr(programCounter); } } if (lineNo >= 0) { return String.valueOf(lineNo); } else { return "?"; }
public final String getLocationInfo() { final VmCompiledCode cc = sfCompiledCode; if ((cc != null) && (sfInstructionPointer != null)) { return cc.getLocationInfo(sfMethod, sfInstructionPointer); } else { return "?"; } }
final VmType vmClass = (method == null) ? null : method.getDeclaringClass();
final VmType<?> vmClass = (method == null) ? null : method.getDeclaringClass();
public String toString() { final VmMethod method = sfMethod; final VmType vmClass = (method == null) ? null : method.getDeclaringClass(); final String cname = (vmClass == null) ? "<unknown class>" : vmClass.getName(); final String mname = (method == null) ? "<unknown method>" : method.getName(); final String location = getLocationInfo(); return cname + "!" + mname + " (" + location + ")"; }
config = ses.getConfiguration();
public PrinterThread (ScreenChar[] sc, Font font, int cols, int rows, Color colorBg, boolean toDefaultPrinter, Session ses) { setPriority(1); session = ses; session.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); screen = new ScreenChar[sc.length]; toDefault = toDefaultPrinter; 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; }
(w < (int)k.getStringBounds("W",f).getWidth() + 1) ||
(w < (int)k.getStringBounds("W",f).getWidth()) ||
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); }
int w1 = (int)k.getStringBounds("W",f).getWidth() + 1;
int w1 = (int)k.getStringBounds("W",f).getWidth();
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); }
y = h1 * m;
y = h1 * (m + 1);
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); }
if (numCols != 132) { if (config.getStringProperty("print.portWidth").length() != 0 && config.getStringProperty("print.portHeight").length() != 0 && config.getStringProperty("print.portImageWidth").length() != 0 && config.getStringProperty("print.portImageHeight").length() != 0 && config.getStringProperty("print.portImage.X").length() != 0 && config.getStringProperty("print.portImage.Y").length() != 0) { Paper paper = pf.getPaper(); paper.setSize( Double.parseDouble(config.getStringProperty("print.portWidth")), Double.parseDouble(config.getStringProperty("print.portHeight"))); paper.setImageableArea( Double.parseDouble(config.getStringProperty("print.portImage.X")), Double.parseDouble(config.getStringProperty("print.portImage.Y")), Double.parseDouble(config.getStringProperty("print.portImageWidth")), Double.parseDouble(config.getStringProperty("print.portImageHeight"))); pf.setPaper(paper); } } else { if (config.getStringProperty("print.landWidth").length() != 0 && config.getStringProperty("print.landHeight").length() != 0 && config.getStringProperty("print.landImageWidth").length() != 0 && config.getStringProperty("print.landImageHeight").length() != 0 && config.getStringProperty("print.landImage.X").length() != 0 && config.getStringProperty("print.landImage.Y").length() != 0) { Paper paper = pf.getPaper(); paper.setSize( Double.parseDouble(config.getStringProperty("print.landWidth")), Double.parseDouble(config.getStringProperty("print.landHeight"))); paper.setImageableArea( Double.parseDouble(config.getStringProperty("print.landImage.X")), Double.parseDouble(config.getStringProperty("print.landImage.Y")), Double.parseDouble(config.getStringProperty("print.landImageWidth")), Double.parseDouble(config.getStringProperty("print.landImageHeight"))); } }
public void run () {// Toolkit tk = Toolkit.getDefaultToolkit();//int [][] range = new int[][] {//new int[] { 1, 1 }//};// JobAttributes jobAttributes = new JobAttributes(1, JobAttributes.DefaultSelectionType.ALL, JobAttributes.DestinationType.PRINTER, JobAttributes.DialogType.NONE, "file", 1, 1, JobAttributes.MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES, range, "HP LaserJet", JobAttributes.SidesType.ONE_SIDED);//PrintJob job = tk.getPrintJob(null, "Print", jobAttributes, null);//if (job != null) { //--- Create a printerJob object PrinterJob printJob = PrinterJob.getPrinterJob (); printJob.setJobName("tn5250j"); // will have to remember this for the next time. // Always set a page format before call setPrintable to // set the orientation. PageFormat pf = printJob.defaultPage(); if (numCols == 132) pf.setOrientation(PageFormat.LANDSCAPE); else pf.setOrientation(PageFormat.PORTRAIT); //--- Set the printable class to this one since we //--- are implementing the Printable interface printJob.setPrintable (this,pf); // set the cursor back session.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); //--- Show a print dialog to the user. If the user //--- clicks the print button, then print, otherwise //--- cancel the print job if (printJob.printDialog()) { try { // we do this because of loosing focus with jdk 1.4.0 session.requestFocus(); printJob.print(); } catch (Exception PrintException) { PrintException.printStackTrace(); } } else { // we do this because of loosing focus with jdk 1.4.0 session.requestFocus(); } session = null; int len = screen.length; for (int x = 0; x < len; x++) { screen[x] = null; } screen = null; }
if (!(mdSpi instanceof Cloneable)) throw new CloneNotSupportedException();
public Object clone() throws CloneNotSupportedException { if (!(mdSpi instanceof Cloneable)) throw new CloneNotSupportedException(); MessageDigest result = new DummyMessageDigest ((MessageDigestSpi) mdSpi.clone(), this.getAlgorithm()); result.provider = this.getProvider(); return result; }
private setDocumentHandler ( ) {
private void setDocumentHandler (SaxDocHandler myHandler) {
private setDocumentHandler ( ) { }
this.bytecode = bytecode;
public VmCompiledCode(NativeCodeCompiler compiler, VmByteCode bytecode, Address nativeCode, Object compiledCode, int size, VmCompiledExceptionHandler[] eTable, Address defaultExceptionHandler, VmAddressMap addressTable) { this.compiler = compiler; this.magic = compiler.getMagic(); this.bytecode = bytecode; this.nativeCode = nativeCode; this.compiledCode1 = compiledCode; this.eTable = eTable; this.nativeCodeSize1 = size; this.defaultExceptionHandler = defaultExceptionHandler; this.addressTable = addressTable; if (bytecode != null) { bytecode.lock(); } if (addressTable != null) { addressTable.lock(); /*if (bytecode != null) { if (bytecode.getMethod().getDeclaringClass().getName().equals( "org.jnode.vm.TryCatchNPETest")) { addressTable.writeTo(System.out); } }*/ } }
new BorderUIResource.LineBorderUIResource(Color.white),
new BorderUIResource.LineBorderUIResource( new ColorUIResource(255, 255, 0)),
protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoableEdit.undoText", "Undo", "AbstractUndoableEdit.redoText", "Redo", "Button.background", new ColorUIResource(light), "Button.border", new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { return BasicBorders.getButtonBorder(); } }, "Button.darkShadow", new ColorUIResource(shadow), "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "Button.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Button.foreground", new ColorUIResource(darkShadow), "Button.highlight", new ColorUIResource(highLight), "Button.light", new ColorUIResource(highLight), "Button.margin", new InsetsUIResource(2, 2, 2, 2), "Button.shadow", new ColorUIResource(shadow), "Button.textIconGap", new Integer(4), "Button.textShiftOffset", new Integer(0), "CheckBox.background", new ColorUIResource(light), "CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null, null), "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBox.foreground", new ColorUIResource(darkShadow), "CheckBox.icon", BasicIconFactory.getCheckBoxIcon(), "CheckBox.margin",new InsetsUIResource(2, 2, 2, 2), "CheckBox.textIconGap", new Integer(4), "CheckBox.textShiftOffset", new Integer(0), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "CheckBoxMenuItem.background", new ColorUIResource(light), "CheckBoxMenuItem.border", new BasicBorders.MarginBorder(), "CheckBoxMenuItem.borderPainted", Boolean.FALSE, "CheckBoxMenuItem.checkIcon", BasicIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "CheckBoxMenuItem.foreground", new ColorUIResource(darkShadow), "CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "CheckBoxMenuItem.selectionBackground", new ColorUIResource(Color.black), "CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.white), "ColorChooser.background", new ColorUIResource(light), "ColorChooser.cancelText", "Cancel", "ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ColorChooser.foreground", new ColorUIResource(darkShadow), "ColorChooser.hsbBlueText", "B", "ColorChooser.hsbBrightnessText", "B", "ColorChooser.hsbGreenText", "G", "ColorChooser.hsbHueText", "H", "ColorChooser.hsbNameText", "HSB", "ColorChooser.hsbRedText", "R", "ColorChooser.hsbSaturationText", "S", "ColorChooser.okText", "OK", "ColorChooser.previewText", "Preview", "ColorChooser.resetText", "Reset", "ColorChooser.rgbBlueMnemonic", new Integer(66), "ColorChooser.rgbBlueText", "Blue", "ColorChooser.rgbGreenMnemonic", new Integer(71), "ColorChooser.rgbGreenText", "Green", "ColorChooser.rgbNameText", "RGB", "ColorChooser.rgbRedMnemonic", new Integer(82), "ColorChooser.rgbRedText", "Red", "ColorChooser.sampleText", "Sample Text Sample Text", "ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(light), "ColorChooser.swatchesNameText", "Swatches", "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10), "ColorChooser.swatchesRecentText", "Recent:", "ColorChooser.swatchesSwatchSize", new Dimension(10, 10), "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "hidePopup", "PAGE_UP", "pageUpPassThrough", "PAGE_DOWN", "pageDownPassThrough", "HOME", "homePassThrough", "END", "endPassThrough" }), "ComboBox.background", new ColorUIResource(light), "ComboBox.buttonBackground", new ColorUIResource(light), "ComboBox.buttonDarkShadow", new ColorUIResource(shadow), "ComboBox.buttonHighlight", new ColorUIResource(highLight), "ComboBox.buttonShadow", new ColorUIResource(shadow), "ComboBox.disabledBackground", new ColorUIResource(light), "ComboBox.disabledForeground", new ColorUIResource(Color.gray), "ComboBox.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ComboBox.foreground", new ColorUIResource(Color.black), "ComboBox.selectionBackground", new ColorUIResource(Color.black), "ComboBox.selectionForeground", new ColorUIResource(Color.white), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "KP_LEFT", "left", "KP_RIGHT", "right", "ctrl F5", "restore", "LEFT", "left", "ctrl alt F6", "selectNextFrame", "UP", "up", "ctrl F6", "selectNextFrame", "RIGHT", "right", "DOWN", "down", "ctrl F7", "move", "ctrl F8", "resize", "ESCAPE", "escape", "ctrl TAB", "selectNextFrame", "ctrl F9", "minimize", "KP_UP", "up", "ctrl F4", "close", "KP_DOWN", "down", "ctrl F10", "maximize", "ctrl alt shift F6","selectPreviousFrame" }), "Desktop.background", new ColorUIResource(0, 92, 92), "DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null, null), "EditorPane.background", new ColorUIResource(Color.white), "EditorPane.border", new BasicBorders.MarginBorder(), "EditorPane.caretBlinkRate", new Integer(500), "EditorPane.caretForeground", new ColorUIResource(Color.black), "EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "EditorPane.foreground", new ColorUIResource(Color.black), "EditorPane.inactiveForeground", new ColorUIResource(Color.gray), "EditorPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "EditorPane.margin", new InsetsUIResource(3, 3, 3, 3), "EditorPane.selectionBackground", new ColorUIResource(Color.black), "EditorPane.selectionForeground", new ColorUIResource(Color.white), "FileChooser.acceptAllFileFilterText", "All Files (*.*)", "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancelSelection" }), "FileChooser.cancelButtonMnemonic", new Integer(67), "FileChooser.cancelButtonText", "Cancel", "FileChooser.cancelButtonToolTipText", "Abort file chooser dialog", // XXX Don't use gif// "FileChooser.detailsViewIcon", new IconUIResource(new ImageIcon("icons/DetailsView.gif")), "FileChooser.directoryDescriptionText", "Directory", "FileChooser.fileDescriptionText", "Generic File", "FileChooser.helpButtonMnemonic", new Integer(72), "FileChooser.helpButtonText", "Help", "FileChooser.helpButtonToolTipText", "FileChooser help", // XXX Don't use gif// "FileChooser.homeFolderIcon", new IconUIResource(new ImageIcon("icons/HomeFolder.gif")), // XXX Don't use gif// "FileChooser.listViewIcon", new IconUIResource(new ImageIcon("icons/ListView.gif")), "FileChooser.newFolderErrorSeparator", ":", "FileChooser.newFolderErrorText", "Error creating new folder", // XXX Don't use gif// "FileChooser.newFolderIcon", new IconUIResource(new ImageIcon("icons/NewFolder.gif")), "FileChooser.openButtonMnemonic", new Integer(79), "FileChooser.openButtonText", "Open", "FileChooser.openButtonToolTipText", "Open selected file", "FileChooser.saveButtonMnemonic", new Integer(83), "FileChooser.saveButtonText", "Save", "FileChooser.saveButtonToolTipText", "Save selected file", // XXX Don't use gif// "FileChooser.upFolderIcon", new IconUIResource(new ImageIcon("icons/UpFolder.gif")), "FileChooser.updateButtonMnemonic", new Integer(85), "FileChooser.updateButtonText", "Update", "FileChooser.updateButtonToolTipText", "Update directory listing", // XXX Don't use gif// "FileView.computerIcon", new IconUIResource(new ImageIcon("icons/Computer.gif")), // XXX Don't use gif// "FileView.directoryIcon", new IconUIResource(new ImageIcon("icons/Directory.gif")), // XXX Don't use gif// "FileView.fileIcon", new IconUIResource(new ImageIcon("icons/File.gif")), // XXX Don't use gif// "FileView.floppyDriveIcon", new IconUIResource(new ImageIcon("icons/Floppy.gif")), // XXX Don't use gif// "FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")), "FocusManagerClassName", "TODO", "FormattedTextField.background", new ColorUIResource(light), "FormattedTextField.caretForeground", new ColorUIResource(Color.black), "FormattedTextField.foreground", new ColorUIResource(Color.black), "FormattedTextField.inactiveBackground", new ColorUIResource(light), "FormattedTextField.inactiveForeground", new ColorUIResource(Color.gray), "FormattedTextField.selectionBackground", new ColorUIResource(Color.black), "FormattedTextField.selectionForeground", new ColorUIResource(Color.white), "FormView.resetButtonText", "Reset", "FormView.submitButtonText", "Submit Query", "InternalFrame.activeTitleBackground", new ColorUIResource(0, 0, 128), "InternalFrame.activeTitleForeground", new ColorUIResource(Color.white), "InternalFrame.border", new BorderUIResource.CompoundBorderUIResource(null, null), "InternalFrame.borderColor", new ColorUIResource(light), "InternalFrame.borderDarkShadow", new ColorUIResource(shadow), "InternalFrame.borderHighlight", new ColorUIResource(highLight), "InternalFrame.borderLight", new ColorUIResource(light), "InternalFrame.borderShadow", new ColorUIResource(shadow), "InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(), // XXX Don't use gif// "InternalFrame.icon", new IconUIResource(new ImageIcon("icons/JavaCup.gif")), "InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.gray), "InternalFrame.inactiveTitleForeground", new ColorUIResource(Color.lightGray), "InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(), "InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12), "InternalFrame.windowBindings", new Object[] { "shift ESCAPE", "showSystemMenu", "ctrl SPACE", "showSystemMenu", "ESCAPE", "showSystemMenu" }, "Label.background", new ColorUIResource(light), "Label.disabledForeground", new ColorUIResource(Color.white), "Label.disabledShadow", new ColorUIResource(shadow), "Label.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Label.foreground", new ColorUIResource(darkShadow), "List.background", new ColorUIResource(light), "List.border", new BasicBorders.MarginBorder(), "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "ctrl \\", "clearSelection", "PAGE_DOWN", "scrollDown", "shift PAGE_DOWN","scrollDownExtendSelection", "END", "selectLastRow", "HOME", "selectFirstRow", "shift END", "selectLastRowExtendSelection", "shift HOME", "selectFirstRowExtendSelection", "UP", "selectPreviousRow", "ctrl /", "selectAll", "ctrl A", "selectAll", "DOWN", "selectNextRow", "shift UP", "selectPreviousRowExtendSelection", "ctrl SPACE", "selectNextRowExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "KP_UP", "selectPreviousRow", "shift PAGE_UP","scrollUpExtendSelection", "KP_DOWN", "selectNextRow" }), "List.foreground", new ColorUIResource(darkShadow), "List.selectionBackground", new ColorUIResource(Color.black), "List.selectionForeground", new ColorUIResource(Color.white), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.acceleratorForeground", new ColorUIResource(darkShadow), "Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white), "Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(), "Menu.background", new ColorUIResource(light), "Menu.border", new BasicBorders.MarginBorder(), "Menu.borderPainted", Boolean.FALSE, "Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "Menu.consumesTabs", Boolean.TRUE, "Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Menu.foreground", new ColorUIResource(darkShadow), "Menu.margin", new InsetsUIResource(2, 2, 2, 2), "Menu.selectedWindowInputMapBindings", new Object[] { "ESCAPE", "cancel", "DOWN", "selectNext", "KP_DOWN", "selectNext", "UP", "selectPrevious", "KP_UP", "selectPrevious", "LEFT", "selectParent", "KP_LEFT", "selectParent", "RIGHT", "selectChild", "KP_RIGHT", "selectChild", "ENTER", "return", "SPACE", "return" }, "Menu.selectionBackground", new ColorUIResource(Color.black), "Menu.selectionForeground", new ColorUIResource(Color.white), "MenuBar.background", new ColorUIResource(light), "MenuBar.border", new BasicBorders.MenuBarBorder(null, null), "MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuBar.foreground", new ColorUIResource(darkShadow), "MenuBar.highlight", new ColorUIResource(highLight), "MenuBar.shadow", new ColorUIResource(shadow), "MenuBar.windowBindings", new Object[] { "F10", "takeFocus" }, "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "MenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "MenuItem.background", new ColorUIResource(light), "MenuItem.border", new BasicBorders.MarginBorder(), "MenuItem.borderPainted", Boolean.FALSE, "MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), "MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "MenuItem.foreground", new ColorUIResource(darkShadow), "MenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "MenuItem.selectionBackground", new ColorUIResource(Color.black), "MenuItem.selectionForeground", new ColorUIResource(Color.white), "OptionPane.background", new ColorUIResource(light), "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.cancelButtonText", "Cancel", // XXX Don't use gif// "OptionPane.errorIcon",// new IconUIResource(new ImageIcon("icons/Error.gif")), "OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "OptionPane.foreground", new ColorUIResource(darkShadow), // XXX Don't use gif// "OptionPane.informationIcon",// new IconUIResource(new ImageIcon("icons/Inform.gif")), "OptionPane.messageAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), "OptionPane.messageForeground", new ColorUIResource(darkShadow), "OptionPane.minimumSize", new DimensionUIResource(262, 90), "OptionPane.noButtonText", "No", "OptionPane.okButtonText", "OK", // XXX Don't use gif// "OptionPane.questionIcon",// new IconUIResource(new ImageIcon("icons/Question.gif")), // XXX Don't use gif// "OptionPane.warningIcon",// new IconUIResource(new ImageIcon("icons/Warn.gif")), "OptionPane.windowBindings", new Object[] { "ESCAPE", "close" }, "OptionPane.yesButtonText", "Yes", "Panel.background", new ColorUIResource(light), "Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Panel.foreground", new ColorUIResource(Color.black), "PasswordField.background", new ColorUIResource(light), "PasswordField.border", new BasicBorders.FieldBorder(null, null, null, null), "PasswordField.caretBlinkRate", new Integer(500), "PasswordField.caretForeground", new ColorUIResource(Color.black), "PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "PasswordField.foreground", new ColorUIResource(Color.black), "PasswordField.inactiveBackground", new ColorUIResource(light), "PasswordField.inactiveForeground", new ColorUIResource(Color.gray), "PasswordField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept")}, "PasswordField.margin", new InsetsUIResource(0, 0, 0, 0), "PasswordField.selectionBackground", new ColorUIResource(Color.black), "PasswordField.selectionForeground", new ColorUIResource(Color.white), "PopupMenu.background", new ColorUIResource(light), "PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0), "PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PopupMenu.foreground", new ColorUIResource(darkShadow), "ProgressBar.background", new ColorUIResource(light), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(Color.darkGray), "ProgressBar.cellLength", new Integer(1), "ProgressBar.cellSpacing", new Integer(0), "ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ProgressBar.foreground", new ColorUIResource(Color.black), "ProgressBar.selectionBackground", new ColorUIResource(Color.black), "ProgressBar.selectionForeground", new ColorUIResource(light), "ProgressBar.repaintInterval", new Integer(250), "ProgressBar.cycleTime", new Integer(6000), "RadioButton.background", new ColorUIResource(light), "RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "RadioButton.darkShadow", new ColorUIResource(shadow), "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButton.foreground", new ColorUIResource(darkShadow), "RadioButton.highlight", new ColorUIResource(highLight), "RadioButton.icon", BasicIconFactory.getRadioButtonIcon(), "RadioButton.light", new ColorUIResource(highLight), "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButton.shadow", new ColorUIResource(shadow), "RadioButton.textIconGap", new Integer(4), "RadioButton.textShiftOffset", new Integer(0), "RadioButtonMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.acceleratorForeground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), "RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), "RadioButtonMenuItem.background", new ColorUIResource(light), "RadioButtonMenuItem.border", new BasicBorders.MarginBorder(), "RadioButtonMenuItem.borderPainted", Boolean.FALSE, "RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), "RadioButtonMenuItem.foreground", new ColorUIResource(darkShadow), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", new ColorUIResource(Color.black), "RadioButtonMenuItem.selectionForeground", new ColorUIResource(Color.white), "RootPane.defaultButtonWindowKeyBindings", new Object[] { "ENTER", "press", "released ENTER", "release", "ctrl ENTER", "press", "ctrl released ENTER", "release" }, "ScrollBar.background", new ColorUIResource(224, 224, 224), "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "negativeBlockIncrement", "PAGE_DOWN", "positiveBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "positiveUnitIncrement", "KP_UP", "negativeUnitIncrement", "KP_DOWN", "positiveUnitIncrement", "UP", "negativeUnitIncrement", "RIGHT", "negativeUnitIncrement", "KP_LEFT", "positiveUnitIncrement", "DOWN", "positiveUnitIncrement", "KP_RIGHT", "negativeUnitIncrement" }), "ScrollBar.foreground", new ColorUIResource(light), "ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096), "ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8), "ScrollBar.thumb", new ColorUIResource(light), "ScrollBar.thumbDarkShadow", new ColorUIResource(shadow), "ScrollBar.thumbHighlight", new ColorUIResource(highLight), "ScrollBar.thumbShadow", new ColorUIResource(shadow), "ScrollBar.track", new ColorUIResource(light), "ScrollBar.trackHighlight", new ColorUIResource(shadow), "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "scrollUp", "KP_LEFT", "unitScrollLeft", "ctrl PAGE_DOWN","scrollRight", "PAGE_DOWN", "scrollDown", "KP_RIGHT", "unitScrollRight", "LEFT", "unitScrollLeft", "ctrl END", "scrollEnd", "UP", "unitScrollUp", "RIGHT", "unitScrollRight", "DOWN", "unitScrollDown", "ctrl HOME", "scrollHome", "ctrl PAGE_UP", "scrollLeft", "KP_UP", "unitScrollUp", "KP_DOWN", "unitScrollDown" }), "ScrollPane.background", new ColorUIResource(light), "ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(), "ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ScrollPane.foreground", new ColorUIResource(darkShadow), "Separator.background", new ColorUIResource(highLight), "Separator.foreground", new ColorUIResource(shadow), "Separator.highlight", new ColorUIResource(highLight), "Separator.shadow", new ColorUIResource(shadow), "Slider.background", new ColorUIResource(light), "Slider.focus", new ColorUIResource(shadow), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "PAGE_UP", "positiveBlockIncrement", "PAGE_DOWN", "negativeBlockIncrement", "END", "maxScroll", "HOME", "minScroll", "LEFT", "negativeUnitIncrement", "KP_UP", "positiveUnitIncrement", "KP_DOWN", "negativeUnitIncrement", "UP", "positiveUnitIncrement", "RIGHT", "positiveUnitIncrement", "KP_LEFT", "negativeUnitIncrement", "DOWN", "negativeUnitIncrement", "KP_RIGHT", "positiveUnitIncrement" }), "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2), "Slider.foreground", new ColorUIResource(light), "Slider.highlight", new ColorUIResource(highLight), "Slider.shadow", new ColorUIResource(shadow), "Slider.thumbHeight", new Integer(20), "Slider.thumbWidth", new Integer(10), "Slider.tickHeight", new Integer(12), "Spinner.background", new ColorUIResource(light), "Spinner.foreground", new ColorUIResource(light), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "F6", "toggleFocus", "F8", "startResize", "END", "selectMax", "HOME", "selectMin", "LEFT", "negativeIncremnent", "KP_UP", "negativeIncrement", "KP_DOWN", "positiveIncrement", "UP", "negativeIncrement", "RIGHT", "positiveIncrement", "KP_LEFT", "negativeIncrement", "DOWN", "positiveIncrement", "KP_RIGHT", "positiveIncrement" }), "SplitPane.background", new ColorUIResource(light), "SplitPane.border", new BasicBorders.SplitPaneBorder(null, null), "SplitPane.darkShadow", new ColorUIResource(shadow), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", new ColorUIResource(highLight), "SplitPane.shadow", new ColorUIResource(shadow), "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl PAGE_DOWN","navigatePageDown", "ctrl PAGE_UP", "navigatePageUp", "ctrl UP", "requestFocus", "ctrl KP_UP", "requestFocus" }), "TabbedPane.background", new ColorUIResource(light), "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3), "TabbedPane.darkShadow", new ColorUIResource(shadow), "TabbedPane.focus", new ColorUIResource(darkShadow), "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "LEFT", "navigateLeft", "KP_UP", "navigateUp", "ctrl DOWN", "requestFocusForVisibleComponent", "UP", "navigateUp", "KP_DOWN", "navigateDown", "RIGHT", "navigateRight", "KP_LEFT", "navigateLeft", "ctrl KP_DOWN", "requestFocusForVisibleComponent", "KP_RIGHT", "navigateRight", "DOWN", "navigateDown" }), "TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TabbedPane.foreground", new ColorUIResource(darkShadow), "TabbedPane.highlight", new ColorUIResource(highLight), "TabbedPane.light", new ColorUIResource(highLight), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", new ColorUIResource(shadow), "TabbedPane.tabbedPaneTabAreaInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabInsets", new InsetsUIResource(1, 4, 1, 4), "TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2), "TabbedPane.tabbedPaneTabPadInsets", new InsetsUIResource(1, 1, 1, 1), "TabbedPane.tabRunOverlay", new Integer(2), "TabbedPane.textIconGap", new Integer(4), "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN","scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLastColumn", "shift END", "selectLastColumnExtendSelection", "HOME", "selectFirstColumn", "ctrl END", "selectLastRow", "ctrl shift END","selectLastRowExtendSelection", "LEFT", "selectPreviousColumn", "shift HOME", "selectFirstColumnExtendSelection", "UP", "selectPreviousRow", "RIGHT", "selectNextColumn", "ctrl HOME", "selectFirstRow", "shift LEFT", "selectPreviousColumnExtendSelection", "DOWN", "selectNextRow", "ctrl shift HOME","selectFirstRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "F2", "startEditing", "shift RIGHT", "selectNextColumnExtendSelection", "TAB", "selectNextColumnCell", "shift DOWN", "selectNextRowExtendSelection", "ENTER", "selectNextRowCell", "KP_UP", "selectPreviousRow", "KP_DOWN", "selectNextRow", "KP_LEFT", "selectPreviousColumn", "KP_RIGHT", "selectNextColumn", "shift TAB", "selectPreviousColumnCell", "ctrl A", "selectAll", "shift ENTER", "selectPreviousRowCell", "shift KP_DOWN", "selectNextRowExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "ESCAPE", "cancel", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "shift KP_RIGHT", " selectNextColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "shift PAGE_UP", "scrollUpExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "PAGE_UP", "scrollUpChangeSelection" }), "Table.background", new ColorUIResource(light), "Table.focusCellBackground", new ColorUIResource(light), "Table.focusCellForeground", new ColorUIResource(darkShadow), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource(Color.white), "Table.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Table.foreground", new ColorUIResource(darkShadow), "Table.gridColor", new ColorUIResource(Color.gray), "Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0), "Table.selectionBackground", new ColorUIResource(Color.black), "Table.selectionForeground", new ColorUIResource(Color.white), "TableHeader.background", new ColorUIResource(light), "TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0), "TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TableHeader.foreground", new ColorUIResource(darkShadow), "TextArea.background", new ColorUIResource(light), "TextArea.border", new BasicBorders.MarginBorder(), "TextArea.caretBlinkRate", new Integer(500), "TextArea.caretForeground", new ColorUIResource(Color.black), "TextArea.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), "TextArea.foreground", new ColorUIResource(Color.black), "TextArea.inactiveForeground", new ColorUIResource(Color.gray), "TextArea.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextArea.margin", new InsetsUIResource(0, 0, 0, 0), "TextArea.selectionBackground", new ColorUIResource(Color.black), "TextArea.selectionForeground", new ColorUIResource(Color.white), "TextField.background", new ColorUIResource(light), "TextField.border", new BasicBorders.FieldBorder(null, null, null, null), "TextField.caretBlinkRate", new Integer(500), "TextField.caretForeground", new ColorUIResource(Color.black), "TextField.darkShadow", new ColorUIResource(shadow), "TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "TextField.foreground", new ColorUIResource(Color.black), "TextField.highlight", new ColorUIResource(highLight), "TextField.inactiveBackground", new ColorUIResource(light), "TextField.inactiveForeground", new ColorUIResource(Color.gray), "TextField.light", new ColorUIResource(highLight), "TextField.highlight", new ColorUIResource(light), "TextField.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "notify-field-accept"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_DOWN_MASK), "selection-backward"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_DOWN_MASK), "selection-forward"), }, "TextField.margin", new InsetsUIResource(0, 0, 0, 0), "TextField.selectionBackground", new ColorUIResource(Color.black), "TextField.selectionForeground", new ColorUIResource(Color.white), "TextPane.background", new ColorUIResource(Color.white), "TextPane.border", new BasicBorders.MarginBorder(), "TextPane.caretBlinkRate", new Integer(500), "TextPane.caretForeground", new ColorUIResource(Color.black), "TextPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "TextPane.foreground", new ColorUIResource(Color.black), "TextPane.inactiveForeground", new ColorUIResource(Color.gray), "TextPane.keyBindings", new JTextComponent.KeyBinding[] { new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "caret-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "caret-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "page-up"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "page-down"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "insert-break"), new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "insert-tab") }, "TextPane.margin", new InsetsUIResource(3, 3, 3, 3), "TextPane.selectionBackground", new ColorUIResource(Color.black), "TextPane.selectionForeground", new ColorUIResource(Color.white), "TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(), "TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TitledBorder.titleColor", new ColorUIResource(darkShadow), "ToggleButton.background", new ColorUIResource(light), "ToggleButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), "ToggleButton.darkShadow", new ColorUIResource(shadow), "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", "released SPACE", "released" }), "ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToggleButton.foreground", new ColorUIResource(darkShadow), "ToggleButton.highlight", new ColorUIResource(highLight), "ToggleButton.light", new ColorUIResource(light), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.shadow", new ColorUIResource(shadow), "ToggleButton.textIconGap", new Integer(4), "ToggleButton.textShiftOffset", new Integer(0), "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "navigateUp", "KP_UP", "navigateUp", "DOWN", "navigateDown", "KP_DOWN", "navigateDown", "LEFT", "navigateLeft", "KP_LEFT", "navigateLeft", "RIGHT", "navigateRight", "KP_RIGHT", "navigateRight" }), "ToolBar.background", new ColorUIResource(light), "ToolBar.border", new BorderUIResource.EtchedBorderUIResource(), "ToolBar.darkShadow", new ColorUIResource(shadow), "ToolBar.dockingBackground", new ColorUIResource(light), "ToolBar.dockingForeground", new ColorUIResource(Color.red), "ToolBar.floatingBackground", new ColorUIResource(light), "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray), "ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolBar.foreground", new ColorUIResource(darkShadow), "ToolBar.highlight", new ColorUIResource(highLight), "ToolBar.light", new ColorUIResource(highLight), "ToolBar.separatorSize", new DimensionUIResource(20, 20), "ToolBar.shadow", new ColorUIResource(shadow), "ToolTip.background", new ColorUIResource(light), "ToolTip.border", new BorderUIResource.LineBorderUIResource(Color.lightGray), "ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12), "ToolTip.foreground", new ColorUIResource(darkShadow), "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ESCAPE", "cancel" }), "Tree.background", new ColorUIResource(light), "Tree.changeSelectionWithFocus", Boolean.TRUE,// "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.png")),// "Tree.collapsedIcon", new IconUIResource(new ImageIcon("icons/TreeCollapsed.png")), "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, "Tree.editorBorder", new BorderUIResource.LineBorderUIResource(Color.lightGray), "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_DOWN", "scrollDownChangeSelection", "END", "selectLast", "ctrl KP_UP", "selectPreviousChangeLead", "shift END", "selectLastExtendSelection", "HOME", "selectFirst", "ctrl END", "selectLastChangeLead", "ctrl /", "selectAll", "LEFT", "selectParent", "shift HOME", "selectFirstExtendSelection", "UP", "selectPrevious", "ctrl KP_DOWN", "selectNextChangeLead", "RIGHT", "selectChild", "ctrl HOME", "selectFirstChangeLead", "DOWN", "selectNext", "ctrl KP_LEFT", "scrollLeft", "shift UP", "selectPreviousExtendSelection", "F2", "startEditing", "ctrl LEFT", "scrollLeft", "ctrl KP_RIGHT","scrollRight", "ctrl UP", "selectPreviousChangeLead", "shift DOWN", "selectNextExtendSelection", "ENTER", "toggle", "KP_UP", "selectPrevious", "KP_DOWN", "selectNext", "ctrl RIGHT", "scrollRight", "KP_LEFT", "selectParent", "KP_RIGHT", "selectChild", "ctrl DOWN", "selectNextChangeLead", "ctrl A", "selectAll", "shift KP_UP", "selectPreviousExtendSelection", "shift KP_DOWN","selectNextExtendSelection", "ctrl SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_UP", "scrollUpExtendSelection", "ctrl \\", "clearSelection", "shift SPACE", "extendSelection", "ctrl PAGE_UP", "scrollUpChangeLead", "shift PAGE_UP","scrollUpExtendSelection", "SPACE", "toggleSelectionPreserveAnchor", "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "ctrl PAGE_DOWN", "scrollDownChangeLead" }), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12),// "Tree.expandedIcon", new IconUIResource(new ImageIcon("icons/TreeExpanded.png")), "Tree.foreground", new ColorUIResource(Color.black), "Tree.hash", new ColorUIResource(Color.gray),// "Tree.leafIcon", new IconUIResource(new ImageIcon("icons/TreeLeaf.png")), "Tree.leftChildIndent", new Integer(7),// "Tree.openIcon", new IconUIResource(new ImageIcon("icons/TreeOpen.png")), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(16), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", new ColorUIResource(Color.black), "Tree.selectionBorderColor", new ColorUIResource(Color.black), "Tree.selectionForeground", new ColorUIResource(Color.white), "Tree.textBackground", new ColorUIResource(Color.white), "Tree.textForeground", new ColorUIResource(Color.black), "Viewport.background", new ColorUIResource(light), "Viewport.foreground", new ColorUIResource(Color.black), "Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12) }; defaults.putDefaults(uiDefaults); }
protected void loadSystemColors(UIDefaults defaults, String[] value1, boolean value2)
protected void loadSystemColors(UIDefaults defaults, String[] systemColors, boolean useNative)
protected void loadSystemColors(UIDefaults defaults, String[] value1, boolean value2) { // TODO }
System.out.println("DEBUG ["+clazz+"] "+ message);
if (isDebugEnabled()) System.out.println("DEBUG ["+clazz+"] "+ message);
public void debug(Object message) { System.out.println("DEBUG ["+clazz+"] "+ message); }
writeOut(outputstream, "<![CDDATA[");
writeOut(outputstream, "<![CDATA[");
protected void writeDelimitedData(OutputStream outputstream, Locator locator, DelimitedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { String delimiter = readObj.getDelimiter(); String recordTerminator = readObj.getRecordTerminator(); int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; writeOut(outputstream, "<![CDDATA["); do { dataNum ++; try { writeOut(outputstream, getStringData(locator)); writeOut(outputstream, delimiter); } catch (NoDataException e) { //double check, a bug here, "yes" is already printed String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData == null) { readObj.setRepeatable("no"); } else { writeOut(outputstream, noData); } writeOut(outputstream, delimiter); } if (dataNum == fastestAxisLength) { writeOut(outputstream, recordTerminator); dataNum = 0; } } while (locator.next()); writeOut(outputstream, "]]>"); }
void repaintCellFocus()
protected void repaintCellFocus()
void repaintCellFocus() { }
{ BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); }
selectNextIndex();
public void keyPressed( KeyEvent evt ) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); int max = BasicListUI.this.list.getModel().getSize() - 1; // Do nothing if list is empty if (max == -1) return; // Process the key event. Bindings can be found in // javax.swing.plaf.basic.BasicLookAndFeel.java if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (evt.getModifiers() == 0) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (evt.getModifiers() == 0) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); } } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { int target; if (lead == BasicListUI.this.list.getFirstVisibleIndex()) { target = Math.max (0, lead - (BasicListUI.this.list.getLastVisibleIndex() - BasicListUI.this.list.getFirstVisibleIndex() + 1)); } else { target = BasicListUI.this.list.getFirstVisibleIndex(); } if (evt.getModifiers() == 0) BasicListUI.this.list.setSelectedIndex(target); else if (evt.getModifiers() == InputEvent.SHIFT_MASK) BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(target); } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { int target; if (lead == BasicListUI.this.list.getLastVisibleIndex()) { target = Math.min (max, lead + (BasicListUI.this.list.getLastVisibleIndex() - BasicListUI.this.list.getFirstVisibleIndex() + 1)); } else { target = BasicListUI.this.list.getLastVisibleIndex(); } if (evt.getModifiers() == 0) BasicListUI.this.list.setSelectedIndex(target); else if (evt.getModifiers() == InputEvent.SHIFT_MASK) BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(target); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && (evt.getModifiers() == InputEvent.CTRL_MASK)) { BasicListUI.this.list.clearSelection(); } else if ((evt.getKeyCode() == KeyEvent.VK_HOME) || evt.getKeyCode() == KeyEvent.VK_END) { if (evt.getModifiers() != 0 && evt.getModifiers() != InputEvent.SHIFT_MASK) return; // index is either 0 for HOME, or last cell for END int index = (evt.getKeyCode() == KeyEvent.VK_HOME) ? 0 : max; if (!evt.isShiftDown() ||(BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION)) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_INTERVAL_SELECTION) BasicListUI.this.list.setSelectionInterval (BasicListUI.this.list.getAnchorSelectionIndex(), index); else BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(index); } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && (evt.getModifiers() == InputEvent.CTRL_MASK)) { BasicListUI.this.list.setSelectionInterval(0, max); // this next line is to restore the lead selection index to the old // position, because select-all should not change the lead index BasicListUI.this.list.addSelectionInterval(lead, lead); } else if (evt.getKeyCode() == KeyEvent.VK_SPACE && (evt.getModifiers() == InputEvent.CTRL_MASK)) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } BasicListUI.this.list.ensureIndexIsVisible (BasicListUI.this.list.getLeadSelectionIndex()); }
{ BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); }
selectPreviousIndex();
public void keyPressed( KeyEvent evt ) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); int max = BasicListUI.this.list.getModel().getSize() - 1; // Do nothing if list is empty if (max == -1) return; // Process the key event. Bindings can be found in // javax.swing.plaf.basic.BasicLookAndFeel.java if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (evt.getModifiers() == 0) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (evt.getModifiers() == 0) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else if (evt.getModifiers() == InputEvent.SHIFT_MASK) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); } } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { int target; if (lead == BasicListUI.this.list.getFirstVisibleIndex()) { target = Math.max (0, lead - (BasicListUI.this.list.getLastVisibleIndex() - BasicListUI.this.list.getFirstVisibleIndex() + 1)); } else { target = BasicListUI.this.list.getFirstVisibleIndex(); } if (evt.getModifiers() == 0) BasicListUI.this.list.setSelectedIndex(target); else if (evt.getModifiers() == InputEvent.SHIFT_MASK) BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(target); } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { int target; if (lead == BasicListUI.this.list.getLastVisibleIndex()) { target = Math.min (max, lead + (BasicListUI.this.list.getLastVisibleIndex() - BasicListUI.this.list.getFirstVisibleIndex() + 1)); } else { target = BasicListUI.this.list.getLastVisibleIndex(); } if (evt.getModifiers() == 0) BasicListUI.this.list.setSelectedIndex(target); else if (evt.getModifiers() == InputEvent.SHIFT_MASK) BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(target); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && (evt.getModifiers() == InputEvent.CTRL_MASK)) { BasicListUI.this.list.clearSelection(); } else if ((evt.getKeyCode() == KeyEvent.VK_HOME) || evt.getKeyCode() == KeyEvent.VK_END) { if (evt.getModifiers() != 0 && evt.getModifiers() != InputEvent.SHIFT_MASK) return; // index is either 0 for HOME, or last cell for END int index = (evt.getKeyCode() == KeyEvent.VK_HOME) ? 0 : max; if (!evt.isShiftDown() ||(BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION)) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_INTERVAL_SELECTION) BasicListUI.this.list.setSelectionInterval (BasicListUI.this.list.getAnchorSelectionIndex(), index); else BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(index); } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && (evt.getModifiers() == InputEvent.CTRL_MASK)) { BasicListUI.this.list.setSelectionInterval(0, max); // this next line is to restore the lead selection index to the old // position, because select-all should not change the lead index BasicListUI.this.list.addSelectionInterval(lead, lead); } else if (evt.getKeyCode() == KeyEvent.VK_SPACE && (evt.getModifiers() == InputEvent.CTRL_MASK)) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } BasicListUI.this.list.ensureIndexIsVisible (BasicListUI.this.list.getLeadSelectionIndex()); }
if (e.getPropertyName().equals("model")) updateLayoutStateNeeded += modelChanged; else if (e.getPropertyName().equals("selectionModel")) updateLayoutStateNeeded += selectionModelChanged; else if (e.getPropertyName().equals("font")) updateLayoutStateNeeded += fontChanged; else if (e.getPropertyName().equals("fixedCellWidth")) updateLayoutStateNeeded += fixedCellWidthChanged; else if (e.getPropertyName().equals("fixedCellHeight")) updateLayoutStateNeeded += fixedCellHeightChanged; else if (e.getPropertyName().equals("prototypeCellValue")) updateLayoutStateNeeded += prototypeCellValueChanged; else if (e.getPropertyName().equals("cellRenderer")) updateLayoutStateNeeded += cellRendererChanged;
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() == BasicListUI.this.list) { if (e.getOldValue() != null && e.getOldValue() instanceof ListModel) ((ListModel) e.getOldValue()).removeListDataListener(BasicListUI.this.listDataListener); if (e.getNewValue() != null && e.getNewValue() instanceof ListModel) ((ListModel) e.getNewValue()).addListDataListener(BasicListUI.this.listDataListener); } BasicListUI.this.damageLayout(); }
focusListener = new FocusHandler(); listDataListener = new ListDataHandler(); listSelectionListener = new ListSelectionHandler(); mouseInputListener = new MouseInputHandler(); keyListener = new KeyHandler(); propertyChangeListener = new PropertyChangeHandler(); componentListener = new ComponentHandler();
public BasicListUI() { focusListener = new FocusHandler(); listDataListener = new ListDataHandler(); listSelectionListener = new ListSelectionHandler(); mouseInputListener = new MouseInputHandler(); keyListener = new KeyHandler(); propertyChangeListener = new PropertyChangeHandler(); componentListener = new ComponentHandler(); updateLayoutStateNeeded = 1; rendererPane = new CellRendererPane(); }
list.addMouseMotionListener(mouseInputListener); list.addPropertyChangeListener(propertyChangeListener); list.addComponentListener(componentListener);
protected void installListeners() { list.addFocusListener(focusListener); list.getModel().addListDataListener(listDataListener); list.addListSelectionListener(listSelectionListener); list.addMouseListener(mouseInputListener); list.addKeyListener(keyListener); list.addMouseMotionListener(mouseInputListener); list.addPropertyChangeListener(propertyChangeListener); list.addComponentListener(componentListener); }
public FormattedXMLDataIOStyle ()
public FormattedXMLDataIOStyle (Array parentArray)
public FormattedXMLDataIOStyle () { init(); }
init();
this.parentArray = parentArray; init();
public FormattedXMLDataIOStyle () { init(); }
int stop2 = formatCommandList.size(); for (int i = 0; i < stop2; i++) { FormattedIOCmd command = (FormattedIOCmd) formatCommandList.get(i); command.toXMLOutputStream(outputstream, indent);
int end = formatCommandList.size(); for (int i = 0; i < end; i++) { Object command = formatCommandList.get(i); ((XMLDataIOStyle) command).specificIOStyleToXDF(outputstream, indent);
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 stop2 = formatCommandList.size(); for (int i = 0; i < stop2; i++) { FormattedIOCmd command = (FormattedIOCmd) formatCommandList.get(i); command.toXMLOutputStream(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 + ">"); } }
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) { }
return new TitlePaneLayout() { public Dimension preferredLayoutSize(Container c) { return new Dimension(24, 24); } };
return new MetalTitlePaneLayout();
protected LayoutManager createLayout() { return new TitlePaneLayout() { public Dimension preferredLayoutSize(Container c) { return new Dimension(24, 24); } }; }
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); paletteTitleHeight = defaults.getInt("InternalFrame.paletteTitleHeight"); paletteCloseIcon = defaults.getIcon("InternalFrame.paletteCloseIcon"); minIcon = MetalIconFactory.getInternalFrameAltMaximizeIcon(16); title = new JLabel(frame.getTitle(), MetalIconFactory.getInternalFrameDefaultMenuIcon(), SwingConstants.LEFT);
protected void installDefaults() { super.installDefaults(); selectedTextColor = MetalLookAndFeel.getControlTextColor(); selectedTitleColor = MetalLookAndFeel.getWindowTitleBackground(); notSelectedTextColor = MetalLookAndFeel.getInactiveControlTextColor(); notSelectedTitleColor = MetalLookAndFeel.getWindowTitleInactiveBackground(); }
super.paintComponent(g); Dimension d = getSize(); if (frame.isSelected()) g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
Color savedColor = g.getColor(); if (isPalette) paintPalette(g);
public void paintComponent(Graphics g) { // probably need to check the isPalette flag here, if true pass over to // paintPalette(Graphics) super.paintComponent(g); Dimension d = getSize(); if (frame.isSelected()) g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); else g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(0, d.height - 1, d.width - 1, d.height - 1); }
g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(0, d.height - 1, d.width - 1, d.height - 1);
{ paintTitleBackground(g); paintChildren(g); Dimension d = getSize(); if (frame.isSelected()) g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); else g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(0, 0, 0, 0); g.drawLine(d.width - 1, 0, d.width - 1, 0); g.drawLine(0, d.height - 1, d.width - 1, d.height - 1); Rectangle b = title.getBounds(); int startX = b.x + b.width + 5; int endX = startX; if (iconButton.isVisible()) endX = Math.max(iconButton.getX(), endX); else if (maxButton.isVisible()) endX = Math.max(maxButton.getX(), endX); else if (closeButton.isVisible()) endX = Math.max(closeButton.getX(), endX); endX -= 7; if (endX > startX) MetalUtils.fillMetalPattern(g, startX, 3, endX - startX, getHeight() - 6, Color.white, Color.gray); } g.setColor(savedColor);
public void paintComponent(Graphics g) { // probably need to check the isPalette flag here, if true pass over to // paintPalette(Graphics) super.paintComponent(g); Dimension d = getSize(); if (frame.isSelected()) g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); else g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(0, d.height - 1, d.width - 1, d.height - 1); }
Color savedColor = g.getColor(); Rectangle b = SwingUtilities.getLocalBounds(this); g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); g.fillRect(b.x, b.y, b.width, b.height); MetalUtils.fillMetalPattern(g, b.x + 4, b.y + 2, b.width - paletteCloseIcon.getIconWidth() - 13, b.height - 5, MetalLookAndFeel.getPrimaryControlHighlight(), MetalLookAndFeel.getBlack()); Dimension d = getSize(); g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); g.drawLine(0, d.height - 1, d.width - 1, d.height - 1); g.setColor(savedColor);
public void paintPalette(Graphics g) { // FIXME: needs implementing // most likely this is equivalent to paintComponent(g) when the isPalette // flag is true }
isPalette = b;
isPalette = b; title.setVisible(!isPalette); iconButton.setVisible(!isPalette && frame.isIconifiable()); maxButton.setVisible(!isPalette && frame.isMaximizable()); if (isPalette) closeButton.setIcon(paletteCloseIcon); else closeButton.setIcon(closeIcon);
public void setPalette(boolean b) { isPalette = b; }
paletteCloseIcon = null; minIcon = null; title = null;
protected void uninstallDefaults() { super.uninstallDefaults(); selectedTextColor = null; selectedTitleColor = null; notSelectedTextColor = null; notSelectedTitleColor = null; }
return false;
return checkScripts();
private static boolean loadMacros(Properties macs) { FileInputStream in = null; try { in = new FileInputStream(macroName); macs.load(in); return true; } catch (FileNotFoundException fnfe) {System.out.println(fnfe.getMessage());} catch (IOException ioe) {System.out.println(ioe.getMessage());} catch (SecurityException se) { System.out.println(se.getMessage()); } return false; }
if (unit == null) { Log.warn("in Parameter.addUnit(), the Unit passed in is null"); return null; }
public Unit addUnit(Unit unit) { if (unit == null) { Log.warn("in Parameter.addUnit(), the Unit passed in is null"); return null; } return getAxisUnits().addUnit(unit); }
if (group !=null) {
public ValueGroup addValueGroup (ValueGroup group) { if (group !=null) { //add the group to the groupOwnedHash valueGroupOwnedHash.add(group); return group; } else { Log.warn("in Axis,addValueGroup(). ValueGroup passed in is null"); return null; } }
} else { Log.warn("in Axis,addValueGroup(). ValueGroup passed in is null"); return null; }
public ValueGroup addValueGroup (ValueGroup group) { if (group !=null) { //add the group to the groupOwnedHash valueGroupOwnedHash.add(group); return group; } else { Log.warn("in Axis,addValueGroup(). ValueGroup passed in is null"); return null; } }
cloneObj.valueGroupOwnedHash.add(iter.next());
cloneObj.valueGroupOwnedHash.add(((Group)iter.next()).clone());
public Object clone() throws CloneNotSupportedException { Axis cloneObj = (Axis) super.clone(); //deep copy of the valueGroupOwnedHash synchronized (this.valueGroupOwnedHash) { synchronized(cloneObj.valueGroupOwnedHash) { cloneObj.valueGroupOwnedHash = Collections.synchronizedSet(new HashSet(this.valueGroupOwnedHash.size())); Iterator iter = this.valueGroupOwnedHash.iterator(); while (iter.hasNext()) { cloneObj.valueGroupOwnedHash.add(iter.next()); } } } return cloneObj; }
if (valueObj == null) { Log.error("in Axis, getIndexFromAxisValue, Value passed in is null, returning -1"); return -1; } List values = getValueList();
List values = getValueList();
public int getIndexFromAxisValue(Value valueObj) { if (valueObj == null) { Log.error("in Axis, getIndexFromAxisValue, Value passed in is null, returning -1"); return -1; } List values = getValueList(); int size = values.size(); for (int i = 0; i< size; i++){ if (((Value) values.get(i)).getValue().equals(valueObj.getValue())) //if found return i; } //not found return -1; }
protected void init()
private void init()
protected void init() { classXDFNodeName = "axis"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"valueList"); attribOrder.add(0,"axisUnits"); attribOrder.add(0,"axisDatatype"); attribOrder.add(0,"align"); //not sure what it is??? attribOrder.add(0,"axisIdRef"); attribOrder.add(0,"axisId"); attribOrder.add(0,"description"); attribOrder.add(0,"name"); //set up the attribute hashtable key with the default initial value //set the minimum array size(essentially the size of the axis) attribHash.put("valueList", new XMLAttribute(Collections.synchronizedList(new ArrayList(super.sDefaultDataArraySize)), Constants.LIST_TYPE)); attribHash.put("axisIdRef", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("axisId", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("align", new XMLAttribute(null, Constants.STRING_TYPE)); //double check??? //set up the axisUnits attribute Units unitsObj = new Units(); attribHash.put("axisUnits", new XMLAttribute(unitsObj, Constants.OBJECT_TYPE)); unitsObj.setXDFNodeName("axisUnits"); attribHash.put("axisDatatype",new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("description", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("name", new XMLAttribute(null, Constants.STRING_TYPE)); length = 0; }
attribHash.put("valueList", new XMLAttribute(Collections.synchronizedList(new ArrayList(super.sDefaultDataArraySize)), Constants.LIST_TYPE));
attribHash.put("valueList", new XMLAttribute(Collections.synchronizedList(new ArrayList(Specification.getInstance().getDefaultDataArraySize())), Constants.LIST_TYPE));
protected void init() { classXDFNodeName = "axis"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"valueList"); attribOrder.add(0,"axisUnits"); attribOrder.add(0,"axisDatatype"); attribOrder.add(0,"align"); //not sure what it is??? attribOrder.add(0,"axisIdRef"); attribOrder.add(0,"axisId"); attribOrder.add(0,"description"); attribOrder.add(0,"name"); //set up the attribute hashtable key with the default initial value //set the minimum array size(essentially the size of the axis) attribHash.put("valueList", new XMLAttribute(Collections.synchronizedList(new ArrayList(super.sDefaultDataArraySize)), Constants.LIST_TYPE)); attribHash.put("axisIdRef", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("axisId", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("align", new XMLAttribute(null, Constants.STRING_TYPE)); //double check??? //set up the axisUnits attribute Units unitsObj = new Units(); attribHash.put("axisUnits", new XMLAttribute(unitsObj, Constants.OBJECT_TYPE)); unitsObj.setXDFNodeName("axisUnits"); attribHash.put("axisDatatype",new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("description", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("name", new XMLAttribute(null, Constants.STRING_TYPE)); length = 0; }
this.output=output;
public BSHConsole(JTextArea output) { this.out=new BSHOutputAdapter(output); this.output=output; }
FontRenderContext frc = new FontRenderContext(new AffineTransform(), false, false); LineMetrics lmet = m.font.getLineMetrics(m.trimmedText, 0, m.trimmedText.length(), frc); m.lineHeight = (int) lmet.getStrikethroughOffset(); if (m.lineHeight == 0) m.lineHeight = (int) (0.3333 * (double) m.textAscent);
private Measurements getMeasurements(Component c) { Measurements m = new Measurements(); FontMetrics fmet; m.font = getFont(c); fmet = c.getFontMetrics(m.font); m.border = getBorder(); if (m.border != null) m.borderInsets = m.border.getBorderInsets(c); else m.borderInsets = new Insets(0, 0, 0, 0); if (title != null) { m.trimmedText = title.trim(); if (m.trimmedText.length() == 0) m.trimmedText = null; } m.textAscent = fmet.getAscent(); m.textDescent = fmet.getDescent(); if (m.trimmedText != null) m.textWidth = fmet.stringWidth(m.trimmedText) + 3; m.edgeSpacing = new Insets(EDGE_SPACING, EDGE_SPACING, EDGE_SPACING, EDGE_SPACING); m.borderSpacing = new Insets(0, 0, 0, 0); switch (titlePosition) { case ABOVE_TOP: m.borderSpacing.top += m.textAscent + m.textDescent + TEXT_SPACING; break; case BELOW_TOP: m.edgeSpacing.top += m.textAscent + m.textDescent + TEXT_SPACING; break; case ABOVE_BOTTOM: m.edgeSpacing.bottom += m.textAscent + m.textDescent + TEXT_SPACING; break; case BOTTOM: m.edgeSpacing.bottom += Math.max(m.textAscent - m.borderInsets.bottom, 0); m.borderSpacing.bottom += m.textDescent; break; case BELOW_BOTTOM: m.borderSpacing.bottom += m.textAscent + m.textDescent + TEXT_SPACING; break; default: m.borderSpacing.top += m.textAscent; } return m; }
textY = y + mes.borderSpacing.top + mes.borderInsets.top - mes.textAscent;
textY = y + mes.borderSpacing.top + mes.borderInsets.top - mes.textAscent + mes.lineHeight;
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Measurements mes = getMeasurements(c); Font oldFont = g.getFont(); Color oldColor = g.getColor(); /** * A local helper class for painting the border without changing * any pixels inside the rectangle of the title text. */ class BorderPainter { private Component c; private Border b; private int x, y, width, height; /** * Constructs a BorderPainter. * * @param c the component whose border is being painted. * @param b the border object. * @param x the x coordinate of the rectangle delimiting the border. * @param y the y coordinate of the rectangle delimiting the border. * @param width the width of the rectangle delimiting the border. * @param height the width of the rectangle delimiting the border. */ public BorderPainter(Component c, Border b, int x, int y, int width, int height) { this.c = c; this.b = b; this.x = x; this.y = y; this.width = width; this.height = height; } /** * Paints the entire border. */ public void paint(Graphics g) { if (b != null) b.paintBorder(c, g, x, y, width - 1, height - 1); } /** * Paints the border, clipping the drawing operation to a * given rectangular area. */ private void paint(Graphics g, int clipX, int clipY, int clipWidth, int clipHeight) { Shape oldClip = g.getClip(); try { g.clipRect(clipX, clipY, clipWidth, clipHeight); paint(g); } finally { g.setClip(oldClip); } } /** * Paints the border without affecting a given rectangular area. * This is used for painting the border without drawing anything * underneath the title text. * * <p>Since we do not want to introduce unnecessary dependencies * on Java 2D, we perform the clipping without constructive geometry * (provided by java.awt.geom.Area). Instead, the border&#x2019;s * bounding rectangle is split into smaller parts, which are then * clipped and painted individually.: * * <p><pre> * +--------------------+ +--------------------+ * | | | 1 | * | +--------+ | +---+--------+-------+ * | | hole | | |====> | 2 | hole | 3 | * | +--------+ | |---+--------+-------+ * | | | 4 | * +--------------------+ +--------------------+</pre> * */ public void paintExcept(Graphics g, int holeX, int holeY, int holeWidth, int holeHeight) { int stripeHeight; stripeHeight = holeY - y; if (stripeHeight > 0) paint(g, x, y, width, stripeHeight); // patch #1 in the image above stripeHeight = holeHeight; if (stripeHeight > 0) { paint(g, x, holeY, holeX - x, stripeHeight); // patches #2 and #3 paint(g, holeX + holeWidth, holeY, width - (holeX + holeWidth), stripeHeight); } stripeHeight = height - (holeY - y + holeHeight); if (stripeHeight > 0) paint(g, x, y + height - stripeHeight, width, stripeHeight); // #4 } }; BorderPainter bp; int textX, textY, borderWidth, borderHeight; borderWidth = width - (mes.borderSpacing.left + mes.borderSpacing.right); borderHeight = height - (mes.borderSpacing.top + mes.borderSpacing.bottom); bp = new BorderPainter(c, getBorder(), x + mes.borderSpacing.left, y + mes.borderSpacing.top, borderWidth, borderHeight); switch (getRealTitleJustification(c)) { case LEFT: textX = x + TEXT_INSET_H; break; case CENTER: textX = x + (borderWidth - mes.textWidth) / 2; break; case RIGHT: textX = x + borderWidth - (mes.textWidth + TEXT_INSET_H); break; default: throw new IllegalStateException(); } switch (titlePosition) { case ABOVE_TOP: textY = y; break; case TOP: case DEFAULT_POSITION: default: textY = y + mes.borderSpacing.top + mes.borderInsets.top - mes.textAscent; break; case BELOW_TOP: textY = y + mes.borderSpacing.top + mes.borderInsets.top + TEXT_SPACING; break; case ABOVE_BOTTOM: textY = y + height - mes.borderSpacing.bottom - mes.borderInsets.bottom - TEXT_SPACING - (mes.textAscent + mes.textDescent); break; case BOTTOM: case BELOW_BOTTOM: textY = y + height - (mes.textAscent + mes.textDescent); break; } if (mes.trimmedText == null) bp.paint(g); else { try { g.setFont(mes.font); g.setColor(getTitleColor()); g.drawString(mes.trimmedText, textX, textY + mes.textAscent); } finally { g.setFont(oldFont); g.setColor(oldColor); } bp.paintExcept(g, textX - 2, textY, mes.textWidth + 2, mes.textAscent + mes.textDescent); } }
return ;
public void bigBang(int width, int height, double s) { if (width <= 0) throw new RuntimeException( "The method bigBang(int,int,double) expects " + "the first argument to be greather than 0, given " + width); if (height <= 0) throw new RuntimeException( "The method bigBang(int,int,double) expects " + "the second argument to be greather than 0, given " + height); if (s <= 0) throw new RuntimeException( "The method bigBang(int,int,double) expects " + "the third argument to be greather than 0, given " + s); theCanvas = new Canvas(width,height); bigBangO(s); }
float align;
float align = 0.0F; if (interceptor != null && (axis == X_AXIS || axis == Y_AXIS)) {
public float getAlignment(int axis) { float align; if (axis == X_AXIS) align = getComponent().getAlignmentX(); else if (axis == Y_AXIS) align = getComponent().getAlignmentY(); else throw new IllegalArgumentException(); return align; }
align = getComponent().getAlignmentX();
align = interceptor.getAlignmentX();
public float getAlignment(int axis) { float align; if (axis == X_AXIS) align = getComponent().getAlignmentX(); else if (axis == Y_AXIS) align = getComponent().getAlignmentY(); else throw new IllegalArgumentException(); return align; }
align = getComponent().getAlignmentY();
align = interceptor.getAlignmentY(); else assert false : "Must not reach here"; }
public float getAlignment(int axis) { float align; if (axis == X_AXIS) align = getComponent().getAlignmentX(); else if (axis == Y_AXIS) align = getComponent().getAlignmentY(); else throw new IllegalArgumentException(); return align; }
throw new IllegalArgumentException();
align = super.getAlignment(axis);
public float getAlignment(int axis) { float align; if (axis == X_AXIS) align = getComponent().getAlignmentX(); else if (axis == Y_AXIS) align = getComponent().getAlignmentY(); else throw new IllegalArgumentException(); return align; }
if (comp == null) comp = createComponent();
public final Component getComponent() { if (comp == null) comp = createComponent(); return comp; }
float span;
if (axis != X_AXIS && axis != Y_AXIS) throw new IllegalArgumentException("Illegal axis"); float span = 0; if (interceptor != null) {
public float getMaximumSpan(int axis) { float span; if (axis == X_AXIS) span = getComponent().getMaximumSize().width; else if (axis == Y_AXIS) span = getComponent().getMaximumSize().height; else throw new IllegalArgumentException(); return span; }
span = getComponent().getMaximumSize().width;
span = interceptor.getMaximumSize().width;
public float getMaximumSpan(int axis) { float span; if (axis == X_AXIS) span = getComponent().getMaximumSize().width; else if (axis == Y_AXIS) span = getComponent().getMaximumSize().height; else throw new IllegalArgumentException(); return span; }
span = getComponent().getMaximumSize().height;
span = interceptor.getMaximumSize().height;
public float getMaximumSpan(int axis) { float span; if (axis == X_AXIS) span = getComponent().getMaximumSize().width; else if (axis == Y_AXIS) span = getComponent().getMaximumSize().height; else throw new IllegalArgumentException(); return span; }
throw new IllegalArgumentException();
assert false : "Must not reach here"; }
public float getMaximumSpan(int axis) { float span; if (axis == X_AXIS) span = getComponent().getMaximumSize().width; else if (axis == Y_AXIS) span = getComponent().getMaximumSize().height; else throw new IllegalArgumentException(); return span; }
float span;
if (axis != X_AXIS && axis != Y_AXIS) throw new IllegalArgumentException("Illegal axis"); float span = 0; if (interceptor != null) {
public float getMinimumSpan(int axis) { float span; if (axis == X_AXIS) span = getComponent().getMinimumSize().width; else if (axis == Y_AXIS) span = getComponent().getMinimumSize().height; else throw new IllegalArgumentException(); return span; }
span = getComponent().getMinimumSize().width;
span = interceptor.getMinimumSize().width;
public float getMinimumSpan(int axis) { float span; if (axis == X_AXIS) span = getComponent().getMinimumSize().width; else if (axis == Y_AXIS) span = getComponent().getMinimumSize().height; else throw new IllegalArgumentException(); return span; }
span = getComponent().getMinimumSize().height;
span = interceptor.getMinimumSize().height;
public float getMinimumSpan(int axis) { float span; if (axis == X_AXIS) span = getComponent().getMinimumSize().width; else if (axis == Y_AXIS) span = getComponent().getMinimumSize().height; else throw new IllegalArgumentException(); return span; }
throw new IllegalArgumentException();
assert false : "Must not reach here"; }
public float getMinimumSpan(int axis) { float span; if (axis == X_AXIS) span = getComponent().getMinimumSize().width; else if (axis == Y_AXIS) span = getComponent().getMinimumSize().height; else throw new IllegalArgumentException(); return span; }
float span;
if (axis != X_AXIS && axis != Y_AXIS) throw new IllegalArgumentException("Illegal axis"); float span = 0; if (interceptor != null) {
public float getPreferredSpan(int axis) { float span; if (axis == X_AXIS) span = getComponent().getPreferredSize().width; else if (axis == Y_AXIS) span = getComponent().getPreferredSize().height; else throw new IllegalArgumentException(); return span; }
span = getComponent().getPreferredSize().width;
span = interceptor.getPreferredSize().width;
public float getPreferredSpan(int axis) { float span; if (axis == X_AXIS) span = getComponent().getPreferredSize().width; else if (axis == Y_AXIS) span = getComponent().getPreferredSize().height; else throw new IllegalArgumentException(); return span; }