rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
ComboBoxEditor currentEditor = comboBox.getEditor(); if (currentEditor == null || currentEditor instanceof UIResource) { currentEditor = createEditor(); comboBox.setEditor(currentEditor); } editor = currentEditor.getEditorComponent();
if (comboBox.isEditable()) addEditor();
protected void installComponents() { // create drop down list of items popup = createPopup(); listBox = popup.getList(); // set editor and renderer for the combo box. Editor is used // only if combo box becomes editable, otherwise renderer is used // to paint the selected item; combobox is not edit...
comboBox.revalidate();
comboBox.add(currentValuePane);
protected void installComponents() { // create drop down list of items popup = createPopup(); listBox = popup.getList(); // set editor and renderer for the combo box. Editor is used // only if combo box becomes editable, otherwise renderer is used // to paint the selected item; combobox is not edit...
buttonBackground = UIManager.getColor("ComboBox.buttonBackground"); buttonShadow = UIManager.getColor("ComboBox.buttonShadow"); buttonDarkShadow = UIManager.getColor("ComboBox.buttonDarkShadow"); buttonHighlight = UIManager.getColor("ComboBox.buttonHighlight");
LookAndFeel.installBorder(comboBox, "ComboBox.border");
protected void installDefaults() { LookAndFeel.installColorsAndFont(comboBox, "ComboBox.background", "ComboBox.foreground", "ComboBox.font"); // fetch the button color scheme buttonBackground = UIManager.getColor("ComboBox.buttonBackground"); buttonShadow = UIManag...
mouseListener = createMouseListener(); arrowButton.addMouseListener(mouseListener);
protected void installListeners() { // install combo box's listeners propertyChangeListener = createPropertyChangeListener(); comboBox.addPropertyChangeListener(propertyChangeListener); focusListener = createFocusListener(); editor.addFocusListener(focusListener); itemListener = createItemListener(...
popupMouseListener = popup.getMouseListener(); comboBox.addMouseListener(popupMouseListener); popupMouseMotionListener = popup.getMouseMotionListener(); comboBox.addMouseMotionListener(popupMouseMotionListener); popupKeyListener = popup.getKeyListener(); comboBox.addKeyListener(popupKeyListener);
protected void installListeners() { // install combo box's listeners propertyChangeListener = createPropertyChangeListener(); comboBox.addPropertyChangeListener(propertyChangeListener); focusListener = createFocusListener(); editor.addFocusListener(focusListener); itemListener = createItemListener(...
comboBox.setOpaque(true); comboBox.setLayout(createLayoutManager());
public void installUI(JComponent c) { super.installUI(c); if (c instanceof JComboBox) { comboBox = (JComboBox) c; comboBox.setOpaque(true); comboBox.setLayout(createLayoutManager()); installDefaults(); installComponents(); installListeners(); installKeyboardActions(); } }
if (arrowButton != null) configureArrowButton(); if (editor != null) configureEditor(); comboBox.setLayout(createLayoutManager()); comboBox.setFocusable(true);
public void installUI(JComponent c) { super.installUI(c); if (c instanceof JComboBox) { comboBox = (JComboBox) c; comboBox.setOpaque(true); comboBox.setLayout(createLayoutManager()); installDefaults(); installComponents(); installListeners(); installKeyboardActions(); } }
}
public void paint(Graphics g, JComponent c) { Rectangle rect = rectangleForCurrentValue(); paintCurrentValueBackground(g, rect, hasFocus); paintCurrentValue(g, rect, hasFocus); }
if (! comboBox.isEditable()) {
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) { if (! comboBox.isEditable()) { Object currentValue = comboBox.getSelectedItem(); boolean isPressed = arrowButton.getModel().isPressed(); /* Gets the component to be drawn for the current value. * If there is currently no selecte...
Component comp = comboBox.getRenderer().getListCellRendererComponent( listBox, (currentValue != null ? currentValue : ""), -1, isPressed, hasFocus); if (! comboBox.isEnabled())
ListCellRenderer renderer = comboBox.getRenderer(); if (comboBox.getSelectedIndex() != -1) { Component comp; if (hasFocus && ! isPopupVisible(comboBox))
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) { if (! comboBox.isEditable()) { Object currentValue = comboBox.getSelectedItem(); boolean isPressed = arrowButton.getModel().isPressed(); /* Gets the component to be drawn for the current value. * If there is currently no selecte...
comp.setBackground(UIManager.getColor( "ComboBox.disabledBackground")); comp.setForeground(UIManager.getColor( "ComboBox.disabledForeground")); comp.setEnabled(false);
comp = renderer.getListCellRendererComponent(listBox, comboBox.getSelectedItem(), -1, true, false);
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) { if (! comboBox.isEditable()) { Object currentValue = comboBox.getSelectedItem(); boolean isPressed = arrowButton.getModel().isPressed(); /* Gets the component to be drawn for the current value. * If there is currently no selecte...
comp.setBounds(0, 0, bounds.width, bounds.height);
else { comp = renderer.getListCellRendererComponent(listBox, comboBox.getSelectedItem(), -1, false, false); Color bg = UIManager.getColor("ComboBox.disabledForeground"); comp.setBackground(bg); }
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) { if (! comboBox.isEditable()) { Object currentValue = comboBox.getSelectedItem(); boolean isPressed = arrowButton.getModel().isPressed(); /* Gets the component to be drawn for the current value. * If there is currently no selecte...
comp.paint(g); comboBox.revalidate();
if (hasFocus && ! isPopupVisible(comboBox)) { comp.setForeground(listBox.getSelectionForeground()); comp.setBackground(listBox.getSelectionBackground()); } else if (comboBox.isEnabled()) { comp.setForeground(comboBox.getForeground()); comp.setBackground(comboBox.getBackground());
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) { if (! comboBox.isEditable()) { Object currentValue = comboBox.getSelectedItem(); boolean isPressed = arrowButton.getModel().isPressed(); /* Gets the component to be drawn for the current value. * If there is currently no selecte...
comboBox.getEditor().setItem(comboBox.getSelectedItem());
{ Color fg = UIManager.getColor("ComboBox.disabledForeground"); comp.setForeground(fg); Color bg = UIManager.getColor("ComboBox.disabledBackground"); comp.setBackground(bg); } currentValuePane.paintComponent(g, comp, comboBox, bounds.x, bounds.y, bounds.width, bounds.height); }
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) { if (! comboBox.isEditable()) { Object currentValue = comboBox.getSelectedItem(); boolean isPressed = arrowButton.getModel().isPressed(); /* Gets the component to be drawn for the current value. * If there is currently no selecte...
Color saved = g.getColor(); if (comboBox.isEnabled()) { g.setColor(UIManager.getColor("UIManager.background")); } else { g.setColor(UIManager.getColor("UIManager.disabledBackground")); } g.fillRect(bounds.x, bounds.y, bounds.width, bounds.height); g.setColor(saved);
public void paintCurrentValueBackground(Graphics g, Rectangle bounds, boolean hasFocus) { // background is painted by renderer, so it seems that nothing // should be done here. }
}
public void removeEditor() { comboBox.remove(editor); }
if (comboBox.isEditable()) editor.requestFocus(); else comboBox.requestFocus();
public void setPopupVisible(JComboBox c, boolean v) { if (v) popup.show(); else popup.hide(); if (comboBox.isEditable()) editor.requestFocus(); else comboBox.requestFocus(); }
if (arrowButton != null) { if (popupMouseListener != null) arrowButton.removeMouseListener(popupMouseListener); if (popupMouseMotionListener != null) arrowButton.removeMouseMotionListener(popupMouseMotionListener); }
public void unconfigureArrowButton() { // Nothing to do here yet. }
if (popupKeyListener != null) editor.removeKeyListener(popupKeyListener);
protected void unconfigureEditor() { // FIXME: Need to implement }
listBox = null;
protected void uninstallComponents() { // uninstall arrow button unconfigureArrowButton(); comboBox.remove(arrowButton); arrowButton = null; listBox = null; popup = null; comboBox.setRenderer(null); // if the editor is not an instanceof UIResource, it was not set by the // UI delegate, so ...
if (comboBox.getRenderer() instanceof UIResource)
protected void uninstallComponents() { // uninstall arrow button unconfigureArrowButton(); comboBox.remove(arrowButton); arrowButton = null; listBox = null; popup = null; comboBox.setRenderer(null); // if the editor is not an instanceof UIResource, it was not set by the // UI delegate, so ...
buttonBackground = null; buttonShadow = null; buttonDarkShadow = null; buttonHighlight = null;
LookAndFeel.uninstallBorder(comboBox);
protected void uninstallDefaults() { if (comboBox.getFont() instanceof UIResource) comboBox.setFont(null); if (comboBox.getForeground() instanceof UIResource) comboBox.setForeground(null); if (comboBox.getBackground() instanceof UIResource) comboBox.setBackground(null); buttonBackgroun...
arrowButton.removeMouseListener(mouseListener); mouseListener = null;
protected void uninstallListeners() { comboBox.removePropertyChangeListener(propertyChangeListener); propertyChangeListener = null; comboBox.removeFocusListener(focusListener); listBox.removeFocusListener(focusListener); focusListener = null; comboBox.removeItemListener(itemListener); itemListen...
if (popupMouseListener != null) comboBox.removeMouseListener(popupMouseListener); popupMouseListener = null; if (popupMouseMotionListener != null) comboBox.removeMouseMotionListener(popupMouseMotionListener); popupMouseMotionListener = null; if (popupKeyListener != null) comboBox.removeKeyListener(popupKeyListener); ...
protected void uninstallListeners() { comboBox.removePropertyChangeListener(propertyChangeListener); propertyChangeListener = null; comboBox.removeFocusListener(focusListener); listBox.removeFocusListener(focusListener); focusListener = null; comboBox.removeItemListener(itemListener); itemListen...
uninstallComponents();
public void uninstallUI(JComponent c) { uninstallKeyboardActions(); uninstallListeners(); uninstallComponents(); uninstallDefaults(); comboBox = null; }
repaintListener = new DocumentListener() { public void changedUpdate(DocumentEvent ev) { repaint(); } public void insertUpdate(DocumentEvent ev) { repaint(); } public void removeUpdate(DocumentEvent ev) { repaint(); } };
public JTextComponent() { Keymap defkeymap = getKeymap(DEFAULT_KEYMAP); boolean creatingKeymap = false; if (defkeymap == null) { defkeymap = addKeymap(DEFAULT_KEYMAP, null); defkeymap.setDefaultAction(new DefaultEditorKit.DefaultKeyTypedAction()); creatingKeymap = true; } ...
if (oldDoc != null) oldDoc.removeDocumentListener(repaintListener); if (newDoc != null) newDoc.addDocumentListener(repaintListener);
public void setDocument(Document newDoc) { Document oldDoc = doc; doc = newDoc; firePropertyChange("document", oldDoc, newDoc); revalidate(); repaint(); }
el.getDocument().getText(start, start + end, seg);
el.getDocument().getText(start, end - start, seg);
float determineMaxLineLength() { // if the longest line is cached, return the cached value if (maxLineLength != -1) return maxLineLength; // otherwise we have to go through all the lines and find it Element el = getElement(); Segment seg = getLineBuffer(); float span = 0; for (int i = 0...
assert false : "BadLocationException should not be thrown here.";
AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae;
float determineMaxLineLength() { // if the longest line is cached, return the cached value if (maxLineLength != -1) return maxLineLength; // otherwise we have to go through all the lines and find it Element el = getElement(); Segment seg = getLineBuffer(); float span = 0; for (int i = 0...
AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(e); throw ae;
protected void drawLine(int lineIndex, Graphics g, int x, int y) { try { metrics = g.getFontMetrics(); // FIXME: Selected text are not drawn yet. Element line = getElement().getElement(lineIndex); drawUnselectedText(g, x, y, line.getStartOffset(), line.getEndOffset()); //drawSelectedText(g, , , , ); } ...
assert false : "BadLocationException should not be thrown here.";
AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae;
protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { Element el = getElement(); ElementChange ec = changes.getChange(el); // If ec is null then no lines were added or removed, just // repaint the changed line if (ec == null) { int line = getElement().getElement...
int end = line.getEndOffset();
int end = line.getEndOffset() - 1;
public int viewToModel(float x, float y, Shape a, Position.Bias[] b) { Rectangle rec = a.getBounds(); Document doc = getDocument(); Element root = doc.getDefaultRootElement(); // PlainView doesn't support line-wrapping so we can find out which // Element was clicked on just by the y-position ...
AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ble); throw ae;
public int viewToModel(float x, float y, Shape a, Position.Bias[] b) { Rectangle rec = a.getBounds(); Document doc = getDocument(); Element root = doc.getDefaultRootElement(); // PlainView doesn't support line-wrapping so we can find out which // Element was clicked on just by the y-position ...
pseudo = new PseudoInstructions(labels); hwSupport = new X86Support(this, instructions, labels);
pseudo = new PseudoInstructions(labels, constants); hwSupport = new X86Support(this, instructions, labels, constants);
protected Assembler() { pseudo = new PseudoInstructions(labels); hwSupport = new X86Support(this, instructions, labels); }
log.finer("Missing ALIAS argument. Will use [mykey] instead");
if (Configuration.DEBUG) log.fine("Missing ALIAS argument. Will use [mykey] instead");
protected void validate() throws OptionException { if (fileAndAlias.size() < 1) throw new OptionException(Messages.getString("Main.133")); //$NON-NLS-1$ jarFileName = (String) fileAndAlias.get(0); if (! verify) // must have an ALIAS. use "mykey" if undefined if (fileAndAlias.size() <...
if (Configuration.DEBUG)
private void installNewProvider() { log.entering(this.getClass().getName(), "installNewProvider"); //$NON-NLS-1$ providerInstalled = ProviderUtil.addProvider(provider) != -1; log.exiting(this.getClass().getName(), "installNewProvider"); //$NON-NLS-1$ }
if (Configuration.DEBUG)
public static final void main(String[] args) { log.entering(Main.class.getName(), "main", args); //$NON-NLS-1$ Main tool = new Main(); int result = 1; try { tool.processArgs(args); tool.start(); result = 0; } catch (SecurityException x) { log.throwing(Main.cl...
log.finer("Will verify with the following parameters:"); log.finer(" jar-file = '" + jarFileName + "'"); log.finer("Options:"); log.finer(" provider = '" + providerClassName + "'"); log.finer(" verbose ? " + verbose); log.finer(" certs ? " + certs); log.finer(" internalsf ? " + internalSF); log.fi...
if (Configuration.DEBUG) { log.fine("Will verify with the following parameters:"); log.fine(" jar-file = '" + jarFileName + "'"); log.fine("Options:"); log.fine(" provider = '" + providerClassName + "'"); log.fine(" verbose ? " + verbose); log.fine(" certs ? " + certs); log.fine(" internalsf ? " +...
private void processArgs(String[] args) throws Exception { log.entering(this.getClass().getName(), "processArgs", args); //$NON-NLS-1$ cmdLineParser = new ToolParser(); cmdLineParser.initializeParser(); cmdLineParser.parse(args, new ToolParserCallback()); setupCommonParams(); if (verify) { ...
log.finer("Will sign with the following parameters:"); log.finer(" jar-file = '" + jarFileName + "'"); log.finer(" alias = '" + alias + "'"); log.finer("Options:"); log.finer(" keystore = '" + ksURL + "'"); log.finer(" storetype = '" + ksType + "'"); log.finer(" storepass = '" + ksPassword + "'"); ...
if (Configuration.DEBUG) { log.fine("Will sign with the following parameters:"); log.fine(" jar-file = '" + jarFileName + "'"); log.fine(" alias = '" + alias + "'"); log.fine("Options:"); log.fine(" keystore = '" + ksURL + "'"); log.fine(" storetype = '" + ksType + "'"); log.fine(" storepass = '" +...
private void processArgs(String[] args) throws Exception { log.entering(this.getClass().getName(), "processArgs", args); //$NON-NLS-1$ cmdLineParser = new ToolParser(); cmdLineParser.initializeParser(); cmdLineParser.parse(args, new ToolParserCallback()); setupCommonParams(); if (verify) { ...
} if (Configuration.DEBUG)
private void processArgs(String[] args) throws Exception { log.entering(this.getClass().getName(), "processArgs", args); //$NON-NLS-1$ cmdLineParser = new ToolParser(); cmdLineParser.initializeParser(); cmdLineParser.parse(args, new ToolParserCallback()); setupCommonParams(); if (verify) { ...
if (Configuration.DEBUG)
private void setupCommonParams() throws InstantiationException, IllegalAccessException, ClassNotFoundException, IOException { log.entering(this.getClass().getName(), "setupCommonParams"); //$NON-NLS-1$ File jar = new File(jarFileName); if (! jar.exists()) throw new FileNotFoundException(jarFileNam...
log.finest(String.valueOf(signerCertificateChain));
if (Configuration.DEBUG) log.fine(String.valueOf(signerCertificateChain));
private void setupSigningParams() throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, UnsupportedCallbackException, UnrecoverableKeyException { log.entering(this.getClass().getName(), "setupSigningParams"); //$NON-NLS-1$ if (ksURL == null || ksURL.trim().length() ==...
if (Configuration.DEBUG)
private void setupSigningParams() throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, UnsupportedCallbackException, UnrecoverableKeyException { log.entering(this.getClass().getName(), "setupSigningParams"); //$NON-NLS-1$ if (ksURL == null || ksURL.trim().length() ==...
if (Configuration.DEBUG)
private void start() throws Exception { log.entering(this.getClass().getName(), "start"); //$NON-NLS-1$ if (verify) { JarVerifier jv = new JarVerifier(this); jv.start(); } else { JarSigner js = new JarSigner(this); js.start(); } log.exiting(this.getClass()....
if (Configuration.DEBUG)
private void teardown() { log.entering(this.getClass().getName(), "teardown"); //$NON-NLS-1$ if (providerInstalled) ProviderUtil.removeProvider(provider.getName()); log.exiting(this.getClass().getName(), "teardown"); //$NON-NLS-1$ }
throws NotImplementedException
public void actionPerformed(ActionEvent ae) { // TODO: Implement this properly. }
throws NotImplementedException
public void componentMoved(ComponentEvent e) { // TODO: What should be done here, if anything? }
throws NotImplementedException
protected void startTimer() { // TODO: Implement this properly. }
throws NotImplementedException
public void keyPressed(KeyEvent e) { // TODO: What should be done here, if anything? }
throws NotImplementedException
public void keyReleased(KeyEvent e) { // TODO: What should be done here, if anything? }
throws NotImplementedException
public void keyTyped(KeyEvent e) { // TODO: What should be done here, if anything? }
throws NotImplementedException
public void mouseDragged(MouseEvent e) { // TODO: What should be done here, if anything? }
throws NotImplementedException
public void mouseMoved(MouseEvent e) { // TODO: What should be done here, if anything? }
throws NotImplementedException
public void mouseReleased(MouseEvent e) { // TODO: What should be done here, if anything? }
throws NotImplementedException
public void mouseClicked(MouseEvent e) { // TODO: What should be done here, if anything? }
throws NotImplementedException
public void mouseEntered(MouseEvent e) { // TODO: What should be done here, if anything? }
throws NotImplementedException
public void mouseExited(MouseEvent e) { // TODO: What should be done here, if anything? }
throws NotImplementedException
public void mousePressed(MouseEvent e) { // TODO: What should be done here, if anything? }
throws NotImplementedException
protected void removeFromSource() { // TODO: Implement this properly. }
return depth * totalChildIndent;
return BasicTreeUI.this.getRowX(row, depth);
protected int getRowX(int row, int depth) { return depth * totalChildIndent; }
throws NotImplementedException
public void propertyChange(PropertyChangeEvent event) { // TODO: What should be done here, if anything? }
super(name);
public TreeCancelEditingAction(String name) { // TODO: Implement this properly. }
if (isEnabled() && tree.isEditing()) tree.cancelEditing();
public void actionPerformed(ActionEvent e) { // TODO: Implement this properly. }
throws NotImplementedException
public TreeHomeAction(int direction, String name) { // TODO: Implement this properly }
throws NotImplementedException
public void actionPerformed(ActionEvent e) { // TODO: Implement this properly }
throws NotImplementedException
public boolean isEnabled() { // TODO: Implement this properly return false; }
throws NotImplementedException
public TreeIncrementAction(int direction, String name) { // TODO: Implement this properly }
throws NotImplementedException
public void actionPerformed(ActionEvent e) { // TODO: Implement this properly. }
throws NotImplementedException
protected void completeUIInstall() { // TODO: Implement this properly. }
throws NotImplementedException
protected void completeUIUninstall() { // TODO: Implement this properly. }
return UIManager.getColor("Tree.hash");
return hashColor;
protected Color getHashColor() { return UIManager.getColor("Tree.hash"); }
throws NotImplementedException
protected void prepareForUIInstall() { // TODO: Implement this properly. }
throws NotImplementedException
protected void prepareForUIUninstall() { // TODO: Implement this properly. }
UIManager.put("Tree.hash", color);
hashColor = color;
protected void setHashColor(Color color) { // FIXME: Putting something in the UIDefaults map is certainly wrong. UIManager.put("Tree.hash", color); }
{
private static final BigInteger RSADP(final RSAPrivateKey K, BigInteger c) { // 1. If the representative c is not between 0 and n - 1, output // "representative out of range" and stop. final BigInteger n = K.getModulus(); if (c.compareTo(ZERO) < 0 || c.compareTo(n.subtract(ONE)) > 0) { thr...
}
private static final BigInteger RSADP(final RSAPrivateKey K, BigInteger c) { // 1. If the representative c is not between 0 and n - 1, output // "representative out of range" and stop. final BigInteger n = K.getModulus(); if (c.compareTo(ZERO) < 0 || c.compareTo(n.subtract(ONE)) > 0) { thr...
if (rsaBlinding) {
if (rsaBlinding)
private static final BigInteger RSADP(final RSAPrivateKey K, BigInteger c) { // 1. If the representative c is not between 0 and n - 1, output // "representative out of range" and stop. final BigInteger n = K.getModulus(); if (c.compareTo(ZERO) < 0 || c.compareTo(n.subtract(ONE)) > 0) { thr...
{
private static final BigInteger RSAEP(final RSAPublicKey K, final BigInteger m) { // 1. If the representative m is not between 0 and n - 1, output // "representative out of range" and stop. final BigInteger n = K.getModulus(); if (m.compareTo(ZERO) < 0 || m.compareTo(n.subtract(ONE)) > 0) { ...
}
private static final BigInteger RSAEP(final RSAPublicKey K, final BigInteger m) { // 1. If the representative m is not between 0 and n - 1, output // "representative out of range" and stop. final BigInteger n = K.getModulus(); if (m.compareTo(ZERO) < 0 || m.compareTo(n.subtract(ONE)) > 0) { ...
Font font = v.getFont(); FontMetrics fm = v.getContainer().getFontMetrics(font); return fm.getAscent();
updateFontMetrics(v); return fontMetrics.getAscent();
public float getAscent(GlyphView v) { Font font = v.getFont(); FontMetrics fm = v.getContainer().getFontMetrics(font); return fm.getAscent(); }
Font font = v.getFont(); FontMetrics fm = v.getContainer().getFontMetrics(font); int pos = Utilities.getTabbedTextOffset(txt, fm, (int) x,
int pos = Utilities.getTabbedTextOffset(txt, fontMetrics, (int) x,
public int getBoundedPosition(GlyphView v, int p0, float x, float len) { TabExpander te = v.getTabExpander(); Segment txt = v.getText(p0, v.getEndOffset()); Font font = v.getFont(); FontMetrics fm = v.getContainer().getFontMetrics(font); int pos = Utilities.getTabbedTextOffset(txt, fm, (...
return pos;
return pos + p0;
public int getBoundedPosition(GlyphView v, int p0, float x, float len) { TabExpander te = v.getTabExpander(); Segment txt = v.getText(p0, v.getEndOffset()); Font font = v.getFont(); FontMetrics fm = v.getContainer().getFontMetrics(font); int pos = Utilities.getTabbedTextOffset(txt, fm, (...
Font font = v.getFont(); FontMetrics fm = v.getContainer().getFontMetrics(font); return fm.getDescent();
updateFontMetrics(v); return fontMetrics.getDescent();
public float getDescent(GlyphView v) { Font font = v.getFont(); FontMetrics fm = v.getContainer().getFontMetrics(font); return fm.getDescent(); }
Font font = view.getFont(); FontMetrics metrics = Toolkit.getDefaultToolkit().getFontMetrics(font); float height = metrics.getHeight();
updateFontMetrics(view); float height = fontMetrics.getHeight();
public float getHeight(GlyphView view) { Font font = view.getFont(); FontMetrics metrics = Toolkit.getDefaultToolkit().getFontMetrics(font); float height = metrics.getHeight(); return height; }
Font font = view.getFont(); FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(font);
updateFontMetrics(view);
public float getSpan(GlyphView view, int p0, int p1, TabExpander te, float x) { Font font = view.getFont(); FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(font); Segment txt = view.getText(p0, p1); int span = Utilities.getTabbedTextWidth(txt, fm, (int) x, ...
int span = Utilities.getTabbedTextWidth(txt, fm, (int) x, te, p0);
int span = Utilities.getTabbedTextWidth(txt, fontMetrics, (int) x, te, p0);
public float getSpan(GlyphView view, int p0, int p1, TabExpander te, float x) { Font font = view.getFont(); FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(font); Segment txt = view.getText(p0, p1); int span = Utilities.getTabbedTextWidth(txt, fm, (int) x, ...
Font font = view.getFont(); FontMetrics fm = view.getContainer().getFontMetrics(font);
public Shape modelToView(GlyphView view, int pos, Position.Bias b, Shape a) throws BadLocationException { Element el = view.getElement(); Font font = view.getFont(); FontMetrics fm = view.getContainer().getFontMetrics(font); Segment txt = view.getText(el.getSt...
int width = Utilities.getTabbedTextWidth(txt, fm, bounds.x, expander,
int width = Utilities.getTabbedTextWidth(txt, fontMetrics, bounds.x, expander,
public Shape modelToView(GlyphView view, int pos, Position.Bias b, Shape a) throws BadLocationException { Element el = view.getElement(); Font font = view.getFont(); FontMetrics fm = view.getContainer().getFontMetrics(font); Segment txt = view.getText(el.getSt...
int height = fm.getHeight();
int height = fontMetrics.getHeight();
public Shape modelToView(GlyphView view, int pos, Position.Bias b, Shape a) throws BadLocationException { Element el = view.getElement(); Font font = view.getFont(); FontMetrics fm = view.getContainer().getFontMetrics(font); Segment txt = view.getText(el.getSt...
Color oldColor = g.getColor(); int height = (int) getHeight(view);
updateFontMetrics(view); Rectangle r = a instanceof Rectangle ? (Rectangle) a : a.getBounds(); TabExpander tabEx = view.getTabExpander();
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare...
Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent;
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare...
int width = Utilities.getTabbedTextWidth(txt, g.getFontMetrics(), bounds.x, tabEx, txt.offset); Color background = view.getBackground(); if (background != null)
int x = r.x; int p = view.getStartOffset(); if (p != p0)
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare...
g.setColor(background); g.fillRect(bounds.x, bounds.y, width, height);
int width = Utilities.getTabbedTextWidth(txt, fontMetrics,x, tabEx, p); x += width;
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare...
g.setColor(view.getForeground()); g.setFont(view.getFont()); int ascent = g.getFontMetrics().getAscent(); Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent, g, tabEx, txt.offset);
int y = r.y + fontMetrics.getHeight() - fontMetrics.getDescent();
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare...
if (view.isStrikeThrough()) { int strikeHeight = (int) (getAscent(view) / 2); g.drawLine(bounds.x, bounds.y + strikeHeight, bounds.x + width, bounds.y + strikeHeight); } if (view.isUnderline()) { int lineHeight = (int) getAscent(view); g.drawLine(bounds.x, bounds.y + lineHeight, bounds.x + width, bounds.y + lineHeight)...
g.setFont(fontMetrics.getFont()); Utilities.drawTabbedText(txt, x, y, g, tabEx, p0);
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getPare...
Rectangle b = a.getBounds(); int pos = getBoundedPosition(v, v.getStartOffset(), b.x, x - b.x); return pos;
Rectangle r = a instanceof Rectangle ? (Rectangle) a : a.getBounds(); int p0 = v.getStartOffset(); int p1 = v.getEndOffset(); TabExpander te = v.getTabExpander(); Segment s = v.getText(p0, p1); int offset = Utilities.getTabbedTextOffset(s, fontMetrics, r.x, (int) x, te, p0); int ret = p0 + offset; if (ret == p1) ret--;...
public int viewToModel(GlyphView v, float x, float y, Shape a, Bias[] biasRet) { Rectangle b = a.getBounds(); int pos = getBoundedPosition(v, v.getStartOffset(), b.x, x - b.x); return pos; }
startOffset = -1; endOffset = -1;
offset = 0; length = 0;
public GlyphView(Element element) { super(element); startOffset = -1; endOffset = -1; }
if (axis == Y_AXIS) return this; checkPainter(); Segment txt = new Segment(); try
View brokenView = this; if (axis == X_AXIS)
public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); // Try to find a suitable line break. Segment txt = new Segment(); try { int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getT...
int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getText(start, length, txt);
checkPainter(); int end = glyphPainter.getBoundedPosition(this, p0, pos, len); int breakLoc = getBreakLocation(p0, end); if (breakLoc != -1) end = breakLoc; if (p0 != getStartOffset() || end != getEndOffset()) { brokenView = createFragment(p0, end); if (brokenView instanceof GlyphView) ((GlyphView) brokenView).tabX = p...
public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); // Try to find a suitable line break. Segment txt = new Segment(); try { int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getT...
catch (BadLocationException ex) { AssertionError err = new AssertionError("BadLocationException must not " + "be thrown here."); err.initCause(ex); throw err;
public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); // Try to find a suitable line break. Segment txt = new Segment(); try { int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getT...