public int getVerticalAlignment() { if((delegate_==this)||(delegate_==null)) return super.getVerticalAlignment(); return delegate_.getVerticalAlignment(); }
@ScriptFunction(jsDoc = "" + "/**\n" + " * Vertical position of the text with the icon relative to the component's size.\n" + " */") @Override public int getVerticalAlignment() { return super.getVerticalAlignment(); }
private static int getLabelBaselineResizeBehavior(JLabel label) { if (label.getClientProperty("html") != null) { return BRB_OTHER; } switch(label.getVerticalAlignment()) { case JLabel.TOP: return BRB_CONSTANT_ASCENT; case JLabel.BOTTOM: return BRB_CONSTANT_DESCENT; case JLabel.CENTER: return BRB_CENTER_OFFSET; } return BRB_OTHER; }
protected LineText(LineText lineText) throws CloneNotSupportedException { getLabel().setHorizontalAlignment(lineText.getLabel().getHorizontalAlignment()); getLabel().setVerticalAlignment(lineText.getLabel().getVerticalAlignment()); getLabel().setForeground(lineText.getLabel().getForeground()); getLabel().setBorder(lineText.getLabel().getBorder()); getLabel().setText(lineText.getLabel().getText()); converter = lineText.converter; }
switch (label.getVerticalAlignment()) { case SwingConstants.TOP: yOffset = 0;
protected Vector layoutCL( Graphics g, JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR ) { return layoutCompoundLabel( g, (JComponent)label, fontMetrics, text, icon, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), viewR, iconR, textR, label.getIconTextGap() ); }
private int getLabelBaseline(JLabel label, int height) { Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon(); FontMetrics fm = label.getFontMetrics(label.getFont()); resetRects(label, height); SwingUtilities.layoutCompoundLabel(label, fm, "a", icon, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), viewRect, iconRect, textRect, label.getIconTextGap()); return textRect.y + fm.getAscent(); }
private static int getLabelBaseline(JLabel label, int height) { Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon(); FontMetrics fm = label.getFontMetrics(label.getFont()); resetRects(label, height); SwingUtilities.layoutCompoundLabel(label, fm, "a", icon, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), viewRect, iconRect, textRect, label.getIconTextGap()); return textRect.y + fm.getAscent(); }
label.getText(), icon, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(),
/** * {@inheritDoc} <p> * * Paints a diagonal cross over the text if the comp is of type JLabel, * does nothing otherwise. */ @Override protected void doPaint(Graphics2D g, JComponent comp, int width, int height) { if (!(comp instanceof JLabel)) return; JLabel label = (JLabel) comp; Insets insets = label.getInsets(insetss); paintViewR.x = insets.left; paintViewR.y = insets.top; paintViewR.width = width - (insets.left + insets.right); paintViewR.height = height - (insets.top + insets.bottom); paintIconR.x = paintIconR.y = paintIconR.width = paintIconR.height = 0; paintTextR.x = paintTextR.y = paintTextR.width = paintTextR.height = 0; SwingUtilities.layoutCompoundLabel(label, label.getFontMetrics(label.getFont()), label.getText(), null, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), paintViewR, paintIconR, paintTextR, label.getIconTextGap()); doPaint(g, paintTextR); }
/** * {@inheritDoc} <p> * * Paints a diagonal cross over the text if the comp is of type JLabel, * does nothing otherwise. */ @Override protected void doPaint(Graphics2D g, JComponent comp, int width, int height) { if (!(comp instanceof JLabel)) return; JLabel label = (JLabel) comp; Insets insets = label.getInsets(insetss); paintViewR.x = insets.left; paintViewR.y = insets.top; paintViewR.width = width - (insets.left + insets.right); paintViewR.height = height - (insets.top + insets.bottom); paintIconR.x = paintIconR.y = paintIconR.width = paintIconR.height = 0; paintTextR.x = paintTextR.y = paintTextR.width = paintTextR.height = 0; SwingUtilities.layoutCompoundLabel(label, label.getFontMetrics(label.getFont()), label.getText(), null, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), paintViewR, paintIconR, paintTextR, label.getIconTextGap()); doPaint(g, paintTextR); }
/** * {@inheritDoc} <p> * * Paints a diagonal cross over the text if the comp is of type JLabel, * does nothing otherwise. */ @Override protected void doPaint(Graphics2D g, JComponent comp, int width, int height) { if (!(comp instanceof JLabel)) return; JLabel label = (JLabel) comp; Insets insets = label.getInsets(insetss); paintViewR.x = insets.left; paintViewR.y = insets.top; paintViewR.width = width - (insets.left + insets.right); paintViewR.height = height - (insets.top + insets.bottom); paintIconR.x = paintIconR.y = paintIconR.width = paintIconR.height = 0; paintTextR.x = paintTextR.y = paintTextR.width = paintTextR.height = 0; SwingUtilities.layoutCompoundLabel(label, label.getFontMetrics(label.getFont()), label.getText(), null, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), paintViewR, paintIconR, paintTextR, label.getIconTextGap()); doPaint(g, paintTextR); }
/** * {@inheritDoc} <p> * * Paints a diagonal cross over the text if the comp is of type JLabel, * does nothing otherwise. */ @Override protected void doPaint(Graphics2D g, JComponent comp, int width, int height) { if (!(comp instanceof JLabel)) return; JLabel label = (JLabel) comp; Insets insets = label.getInsets(insetss); paintViewR.x = insets.left; paintViewR.y = insets.top; paintViewR.width = width - (insets.left + insets.right); paintViewR.height = height - (insets.top + insets.bottom); paintIconR.x = paintIconR.y = paintIconR.width = paintIconR.height = 0; paintTextR.x = paintTextR.y = paintTextR.width = paintTextR.height = 0; SwingUtilities.layoutCompoundLabel(label, label.getFontMetrics(label.getFont()), label.getText(), null, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), paintViewR, paintIconR, paintTextR, label.getIconTextGap()); doPaint(g, paintTextR); }
/** * {@inheritDoc} <p> * * Paints a diagonal cross over the text if the comp is of type JLabel, * does nothing otherwise. */ @Override protected void doPaint(Graphics2D g, JComponent comp, int width, int height) { if (!(comp instanceof JLabel)) return; JLabel label = (JLabel) comp; Insets insets = label.getInsets(insetss); paintViewR.x = insets.left; paintViewR.y = insets.top; paintViewR.width = width - (insets.left + insets.right); paintViewR.height = height - (insets.top + insets.bottom); paintIconR.x = paintIconR.y = paintIconR.width = paintIconR.height = 0; paintTextR.x = paintTextR.y = paintTextR.width = paintTextR.height = 0; SwingUtilities.layoutCompoundLabel(label, label.getFontMetrics(label.getFont()), label.getText(), null, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), paintViewR, paintIconR, paintTextR, label.getIconTextGap()); doPaint(g, paintTextR); }
protected void paint(SeaGlassContext context, Graphics g) { JLabel label = (JLabel) context.getComponent(); Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon(); g.setColor(context.getStyle().getColor(context, ColorType.TEXT_FOREGROUND)); g.setFont(style.getFont(context)); context.getStyle().getGraphicsUtils(context).paintText(context, g, label.getText(), icon, label.getHorizontalAlignment(), label.getVerticalAlignment(), label.getHorizontalTextPosition(), label.getVerticalTextPosition(), label.getIconTextGap(), label.getDisplayedMnemonicIndex(), 0); }
FontMetrics fm = context.getComponent().getFontMetrics(context.getStyle().getFont(context)); context.getStyle().getGraphicsUtils(context).layoutText(context, fm, label.getText(), label.getIcon(), label.getHorizontalAlignment(), label.getVerticalAlignment(), label.getHorizontalTextPosition(), label.getVerticalTextPosition(), viewRect, iconRect, textRect, label.getIconTextGap()); View view = (View) label.getClientProperty(BasicHTML.propertyKey);
/** * Forwards the call to SwingUtilities.layoutCompoundLabel(). * This method is here so that a subclass could do Label specific * layout and to shorten the method name a little. * * @see SwingUtilities#layoutCompoundLabel */ @Override protected String layoutCL( JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR) { return SwingUtilities.layoutCompoundLabel( (JComponent) label, fontMetrics, text, icon, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), viewR, iconR, textR, label.getIconTextGap()); }
public Dimension getMaximumSize(JComponent c) { JLabel label = (JLabel) c; Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon(); SeaGlassContext context = getContext(c); Dimension size = context.getStyle().getGraphicsUtils(context).getMaximumSize(context, context.getStyle().getFont(context), label.getText(), icon, label.getHorizontalAlignment(), label.getVerticalAlignment(), label.getHorizontalTextPosition(), label.getVerticalTextPosition(), label.getIconTextGap(), label.getDisplayedMnemonicIndex()); context.dispose(); return size; }
public Dimension getMinimumSize(JComponent c) { JLabel label = (JLabel) c; Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon(); SeaGlassContext context = getContext(c); Dimension size = context.getStyle().getGraphicsUtils(context).getMinimumSize(context, context.getStyle().getFont(context), label.getText(), icon, label.getHorizontalAlignment(), label.getVerticalAlignment(), label.getHorizontalTextPosition(), label.getVerticalTextPosition(), label.getIconTextGap(), label.getDisplayedMnemonicIndex()); context.dispose(); return size; }
public Dimension getPreferredSize(JComponent c) { JLabel label = (JLabel) c; Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon(); SeaGlassContext context = getContext(c); Dimension size = context.getStyle().getGraphicsUtils(context).getPreferredSize(context, context.getStyle().getFont(context), label.getText(), icon, label.getHorizontalAlignment(), label.getVerticalAlignment(), label.getHorizontalTextPosition(), label.getVerticalTextPosition(), label.getIconTextGap(), label.getDisplayedMnemonicIndex()); context.dispose(); return size; }