/** * Returns the alignment of the separator line relative to the label. * * @return the separator alignment. SwingConstants.LEFT, CENTER, or RIGHT */ public int getAlignment() { return m_label.getHorizontalAlignment(); }
/** Get the label's horizontal alignment */ public int getLabelAlignment() { return theLabel.getHorizontalAlignment(); }
@ScriptFunction(jsDoc = "" + "/**\n" + " * Horizontal position of the text with the icon relative to the component's size.\n" + " */") @Override public int getHorizontalAlignment() { return super.getHorizontalAlignment(); }
static boolean isLeadingAlign(Component component) { int alignment; if (component instanceof ProfilerRenderer) { alignment = ((ProfilerRenderer)component).getHorizontalAlignment(); } else if (component instanceof JLabel) { alignment = ((JLabel)component).getHorizontalAlignment(); } else { alignment = SwingConstants.LEADING; } return alignment == SwingConstants.LEADING || alignment == SwingConstants.LEFT; }
public int getHorizontalAlignment() { if((delegate_==this)||(delegate_==null)) return super.getHorizontalAlignment(); return delegate_.getHorizontalAlignment(); }
/** * Sets the alignment of the separator line relative to the label. * * @param alignment * the alignment to set. SwingConstants.LEFT, CENTER, or RIGHT */ public void setAlignment(int alignment) { if (m_label.getHorizontalAlignment() == alignment) return; m_label.setHorizontalAlignment(alignment); createSeparator(m_label); }
/** * @return label alignments */ public final int getAlignment() { return getLabel().getHorizontalAlignment(); }
/** * Gets the horizontal alignment of the text. * @return the horizontal alignment of the text */ public HorizontalAlignment getHorizontalAlignment() { JLabel label = (JLabel) getComponent(); return label != null ? HorizontalAlignment.getHorizontalAlignment(label.getHorizontalAlignment()) : HorizontalAlignment.getHorizontalAlignment(new JLabel().getHorizontalAlignment()); }
public Component getTableCellRendererComponentPersistent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { return new LabelBracketTableCellRenderer(label1.getHorizontalAlignment()).getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); }
public Component getTableCellRendererComponentPersistent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { return new LabelTableCellRenderer(label.getHorizontalAlignment()).getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); }
public Component getTableCellRendererComponentPersistent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { return new ClassNameTableCellRenderer(label1.getHorizontalAlignment()).getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); }
public int getAlignment(Component rendererComponent, int row, int column) { if (rendererComponent instanceof JLabel) { return getAlignment(((JLabel)rendererComponent).getHorizontalAlignment()); } else if (rendererComponent instanceof AbstractButton) { return getAlignment(((AbstractButton)rendererComponent).getHorizontalAlignment()); } return SwingConstants.CENTER; }
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; }
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(); }
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); }
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; }
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; }