下面列出了怎么用java.awt.LayoutManager的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Package private method which returns either BorderLayout.NORTH,
* BorderLayout.SOUTH, BorderLayout.EAST, or BorderLayout.WEST depending
* on the location of the toolbar in its parent. The toolbar might be
* in PAGE_START, PAGE_END, CENTER, or some other position, but will be
* resolved to either NORTH,SOUTH,EAST, or WEST based on where the toolbar
* actually IS, with CENTER being NORTH.
*
* This code is used to determine where the border line should be drawn
* by the custom toolbar states, and also used by NimbusIcon to determine
* whether the handle icon needs to be shifted to look correct.
*
* Toollbars are unfortunately odd in the way these things are handled,
* and so this code exists to unify the logic related to toolbars so it can
* be shared among the static files such as NimbusIcon and generated files
* such as the ToolBar state classes.
*/
static Object resolveToolbarConstraint(JToolBar toolbar) {
//NOTE: we don't worry about component orientation or PAGE_END etc
//because the BasicToolBarUI always uses an absolute position of
//NORTH/SOUTH/EAST/WEST.
if (toolbar != null) {
Container parent = toolbar.getParent();
if (parent != null) {
LayoutManager m = parent.getLayout();
if (m instanceof BorderLayout) {
BorderLayout b = (BorderLayout)m;
Object con = b.getConstraints(toolbar);
if (con == SOUTH || con == EAST || con == WEST) {
return con;
}
return NORTH;
}
}
}
return NORTH;
}
/**
* Package private method which returns either BorderLayout.NORTH,
* BorderLayout.SOUTH, BorderLayout.EAST, or BorderLayout.WEST depending
* on the location of the toolbar in its parent. The toolbar might be
* in PAGE_START, PAGE_END, CENTER, or some other position, but will be
* resolved to either NORTH,SOUTH,EAST, or WEST based on where the toolbar
* actually IS, with CENTER being NORTH.
*
* This code is used to determine where the border line should be drawn
* by the custom toolbar states, and also used by NimbusIcon to determine
* whether the handle icon needs to be shifted to look correct.
*
* Toollbars are unfortunately odd in the way these things are handled,
* and so this code exists to unify the logic related to toolbars so it can
* be shared among the static files such as NimbusIcon and generated files
* such as the ToolBar state classes.
*/
static Object resolveToolbarConstraint(JToolBar toolbar) {
//NOTE: we don't worry about component orientation or PAGE_END etc
//because the BasicToolBarUI always uses an absolute position of
//NORTH/SOUTH/EAST/WEST.
if (toolbar != null) {
Container parent = toolbar.getParent();
if (parent != null) {
LayoutManager m = parent.getLayout();
if (m instanceof BorderLayout) {
BorderLayout b = (BorderLayout)m;
Object con = b.getConstraints(toolbar);
if (con == SOUTH || con == EAST || con == WEST) {
return con;
}
return NORTH;
}
}
}
return NORTH;
}
private JPanel getMainJPanel() {
JPanel mainJPanel = new JPanel();
LayoutManager layout = new BoxLayout(mainJPanel, BoxLayout.Y_AXIS);
mainJPanel.setLayout(layout);
JPanel settingsJPanel = getSettingsJPanel();
JPanel buttonsJPanel = getButtonsJPanel();
mainJPanel.add(settingsJPanel);
mainJPanel.add(Box.createRigidArea(new Dimension(4, 2)));
mainJPanel.add(buttonsJPanel);
mainJPanel.add(Box.createRigidArea(new Dimension(4, 4)));
// mainJPanel.add(Box.createHorizontalGlue());
return mainJPanel;
}
/**
* Package private method which returns either BorderLayout.NORTH,
* BorderLayout.SOUTH, BorderLayout.EAST, or BorderLayout.WEST depending
* on the location of the toolbar in its parent. The toolbar might be
* in PAGE_START, PAGE_END, CENTER, or some other position, but will be
* resolved to either NORTH,SOUTH,EAST, or WEST based on where the toolbar
* actually IS, with CENTER being NORTH.
*
* This code is used to determine where the border line should be drawn
* by the custom toolbar states, and also used by NimbusIcon to determine
* whether the handle icon needs to be shifted to look correct.
*
* Toollbars are unfortunately odd in the way these things are handled,
* and so this code exists to unify the logic related to toolbars so it can
* be shared among the static files such as NimbusIcon and generated files
* such as the ToolBar state classes.
*/
static Object resolveToolbarConstraint(JToolBar toolbar) {
//NOTE: we don't worry about component orientation or PAGE_END etc
//because the BasicToolBarUI always uses an absolute position of
//NORTH/SOUTH/EAST/WEST.
if (toolbar != null) {
Container parent = toolbar.getParent();
if (parent != null) {
LayoutManager m = parent.getLayout();
if (m instanceof BorderLayout) {
BorderLayout b = (BorderLayout)m;
Object con = b.getConstraints(toolbar);
if (con == SOUTH || con == EAST || con == WEST) {
return con;
}
return NORTH;
}
}
}
return NORTH;
}
/**
* Package private method which returns either BorderLayout.NORTH,
* BorderLayout.SOUTH, BorderLayout.EAST, or BorderLayout.WEST depending
* on the location of the toolbar in its parent. The toolbar might be
* in PAGE_START, PAGE_END, CENTER, or some other position, but will be
* resolved to either NORTH,SOUTH,EAST, or WEST based on where the toolbar
* actually IS, with CENTER being NORTH.
*
* This code is used to determine where the border line should be drawn
* by the custom toolbar states, and also used by NimbusIcon to determine
* whether the handle icon needs to be shifted to look correct.
*
* Toollbars are unfortunately odd in the way these things are handled,
* and so this code exists to unify the logic related to toolbars so it can
* be shared among the static files such as NimbusIcon and generated files
* such as the ToolBar state classes.
*/
static Object resolveToolbarConstraint(JToolBar toolbar) {
//NOTE: we don't worry about component orientation or PAGE_END etc
//because the BasicToolBarUI always uses an absolute position of
//NORTH/SOUTH/EAST/WEST.
if (toolbar != null) {
Container parent = toolbar.getParent();
if (parent != null) {
LayoutManager m = parent.getLayout();
if (m instanceof BorderLayout) {
BorderLayout b = (BorderLayout)m;
Object con = b.getConstraints(toolbar);
if (con == SOUTH || con == EAST || con == WEST) {
return con;
}
return NORTH;
}
}
}
return NORTH;
}
/**
* Package private method which returns either BorderLayout.NORTH,
* BorderLayout.SOUTH, BorderLayout.EAST, or BorderLayout.WEST depending
* on the location of the toolbar in its parent. The toolbar might be
* in PAGE_START, PAGE_END, CENTER, or some other position, but will be
* resolved to either NORTH,SOUTH,EAST, or WEST based on where the toolbar
* actually IS, with CENTER being NORTH.
*
* This code is used to determine where the border line should be drawn
* by the custom toolbar states, and also used by NimbusIcon to determine
* whether the handle icon needs to be shifted to look correct.
*
* Toollbars are unfortunately odd in the way these things are handled,
* and so this code exists to unify the logic related to toolbars so it can
* be shared among the static files such as NimbusIcon and generated files
* such as the ToolBar state classes.
*/
static Object resolveToolbarConstraint(JToolBar toolbar) {
//NOTE: we don't worry about component orientation or PAGE_END etc
//because the BasicToolBarUI always uses an absolute position of
//NORTH/SOUTH/EAST/WEST.
if (toolbar != null) {
Container parent = toolbar.getParent();
if (parent != null) {
LayoutManager m = parent.getLayout();
if (m instanceof BorderLayout) {
BorderLayout b = (BorderLayout)m;
Object con = b.getConstraints(toolbar);
if (con == SOUTH || con == EAST || con == WEST) {
return con;
}
return NORTH;
}
}
}
return NORTH;
}
/**
* Package private method which returns either BorderLayout.NORTH,
* BorderLayout.SOUTH, BorderLayout.EAST, or BorderLayout.WEST depending
* on the location of the toolbar in its parent. The toolbar might be
* in PAGE_START, PAGE_END, CENTER, or some other position, but will be
* resolved to either NORTH,SOUTH,EAST, or WEST based on where the toolbar
* actually IS, with CENTER being NORTH.
*
* This code is used to determine where the border line should be drawn
* by the custom toolbar states, and also used by NimbusIcon to determine
* whether the handle icon needs to be shifted to look correct.
*
* Toollbars are unfortunately odd in the way these things are handled,
* and so this code exists to unify the logic related to toolbars so it can
* be shared among the static files such as NimbusIcon and generated files
* such as the ToolBar state classes.
*/
static Object resolveToolbarConstraint(JToolBar toolbar) {
//NOTE: we don't worry about component orientation or PAGE_END etc
//because the BasicToolBarUI always uses an absolute position of
//NORTH/SOUTH/EAST/WEST.
if (toolbar != null) {
Container parent = toolbar.getParent();
if (parent != null) {
LayoutManager m = parent.getLayout();
if (m instanceof BorderLayout) {
BorderLayout b = (BorderLayout)m;
Object con = b.getConstraints(toolbar);
if (con == SOUTH || con == EAST || con == WEST) {
return con;
}
return NORTH;
}
}
}
return NORTH;
}
/**
* Package private method which returns either BorderLayout.NORTH,
* BorderLayout.SOUTH, BorderLayout.EAST, or BorderLayout.WEST depending
* on the location of the toolbar in its parent. The toolbar might be
* in PAGE_START, PAGE_END, CENTER, or some other position, but will be
* resolved to either NORTH,SOUTH,EAST, or WEST based on where the toolbar
* actually IS, with CENTER being NORTH.
*
* This code is used to determine where the border line should be drawn
* by the custom toolbar states, and also used by NimbusIcon to determine
* whether the handle icon needs to be shifted to look correct.
*
* Toollbars are unfortunately odd in the way these things are handled,
* and so this code exists to unify the logic related to toolbars so it can
* be shared among the static files such as NimbusIcon and generated files
* such as the ToolBar state classes.
*/
static Object resolveToolbarConstraint(JToolBar toolbar) {
//NOTE: we don't worry about component orientation or PAGE_END etc
//because the BasicToolBarUI always uses an absolute position of
//NORTH/SOUTH/EAST/WEST.
if (toolbar != null) {
Container parent = toolbar.getParent();
if (parent != null) {
LayoutManager m = parent.getLayout();
if (m instanceof BorderLayout) {
BorderLayout b = (BorderLayout)m;
Object con = b.getConstraints(toolbar);
if (con == SOUTH || con == EAST || con == WEST) {
return con;
}
return NORTH;
}
}
}
return NORTH;
}
/**
* Package private method which returns either BorderLayout.NORTH,
* BorderLayout.SOUTH, BorderLayout.EAST, or BorderLayout.WEST depending
* on the location of the toolbar in its parent. The toolbar might be
* in PAGE_START, PAGE_END, CENTER, or some other position, but will be
* resolved to either NORTH,SOUTH,EAST, or WEST based on where the toolbar
* actually IS, with CENTER being NORTH.
*
* This code is used to determine where the border line should be drawn
* by the custom toolbar states, and also used by NimbusIcon to determine
* whether the handle icon needs to be shifted to look correct.
*
* Toollbars are unfortunately odd in the way these things are handled,
* and so this code exists to unify the logic related to toolbars so it can
* be shared among the static files such as NimbusIcon and generated files
* such as the ToolBar state classes.
*/
static Object resolveToolbarConstraint(JToolBar toolbar) {
//NOTE: we don't worry about component orientation or PAGE_END etc
//because the BasicToolBarUI always uses an absolute position of
//NORTH/SOUTH/EAST/WEST.
if (toolbar != null) {
Container parent = toolbar.getParent();
if (parent != null) {
LayoutManager m = parent.getLayout();
if (m instanceof BorderLayout) {
BorderLayout b = (BorderLayout)m;
Object con = b.getConstraints(toolbar);
if (con == SOUTH || con == EAST || con == WEST) {
return con;
}
return NORTH;
}
}
}
return NORTH;
}
public Dimension getPreferredSize(JComponent c) {
LayoutManager layout = c.getLayout();
Dimension d = layout.preferredLayoutSize(c);
String title = ((JPopupMenu)c).getLabel();
if (titleFont == null) {
UIDefaults table = UIManager.getLookAndFeelDefaults();
titleFont = table.getFont("PopupMenu.font");
}
FontMetrics fm = c.getFontMetrics(titleFont);
int stringWidth = 0;
if (title!=null) {
stringWidth += SwingUtilities2.stringWidth(c, fm, title);
}
if (d.width < stringWidth) {
d.width = stringWidth + 8;
Insets i = c.getInsets();
if (i!=null) {
d.width += i.left + i.right;
}
if (border != null) {
i = border.getBorderInsets(c);
d.width += i.left + i.right;
}
return d;
}
return null;
}
public Dimension getPreferredSize(JComponent c) {
LayoutManager layout = c.getLayout();
Dimension d = layout.preferredLayoutSize(c);
String title = ((JPopupMenu)c).getLabel();
if (titleFont == null) {
UIDefaults table = UIManager.getLookAndFeelDefaults();
titleFont = table.getFont("PopupMenu.font");
}
FontMetrics fm = c.getFontMetrics(titleFont);
int stringWidth = 0;
if (title!=null) {
stringWidth += SwingUtilities2.stringWidth(c, fm, title);
}
if (d.width < stringWidth) {
d.width = stringWidth + 8;
Insets i = c.getInsets();
if (i!=null) {
d.width += i.left + i.right;
}
if (border != null) {
i = border.getBorderInsets(c);
d.width += i.left + i.right;
}
return d;
}
return null;
}
/**
* Constuctor for specifying the LayoutManager of the panel.
*
* @param layout the LayountManger for the panel
*/
public ScrollablePanel(LayoutManager layout) {
super(layout);
IncrementInfo block = new IncrementInfo(IncrementType.PERCENT, 100);
IncrementInfo unit = new IncrementInfo(IncrementType.PERCENT, 10);
setScrollableBlockIncrement(HORIZONTAL, block);
setScrollableBlockIncrement(VERTICAL, block);
setScrollableUnitIncrement(HORIZONTAL, unit);
setScrollableUnitIncrement(VERTICAL, unit);
}
public Dimension getPreferredSize(JComponent c) {
LayoutManager layout = c.getLayout();
Dimension d = layout.preferredLayoutSize(c);
String title = ((JPopupMenu)c).getLabel();
if (titleFont == null) {
UIDefaults table = UIManager.getLookAndFeelDefaults();
titleFont = table.getFont("PopupMenu.font");
}
FontMetrics fm = c.getFontMetrics(titleFont);
int stringWidth = 0;
if (title!=null) {
stringWidth += SwingUtilities2.stringWidth(c, fm, title);
}
if (d.width < stringWidth) {
d.width = stringWidth + 8;
Insets i = c.getInsets();
if (i!=null) {
d.width += i.left + i.right;
}
if (border != null) {
i = border.getBorderInsets(c);
d.width += i.left + i.right;
}
return d;
}
return null;
}
@Override
public void setLayout(LayoutManager mgr) {
if (mgr instanceof PrecisionLayout) {
super.setLayout(mgr);
} else {
throw new IllegalArgumentException("Must use a PrecisionLayout.");
}
}
public Dimension getPreferredSize(JComponent c) {
LayoutManager layout = c.getLayout();
Dimension d = layout.preferredLayoutSize(c);
String title = ((JPopupMenu)c).getLabel();
if (titleFont == null) {
UIDefaults table = UIManager.getLookAndFeelDefaults();
titleFont = table.getFont("PopupMenu.font");
}
FontMetrics fm = c.getFontMetrics(titleFont);
int stringWidth = 0;
if (title!=null) {
stringWidth += SwingUtilities2.stringWidth(c, fm, title);
}
if (d.width < stringWidth) {
d.width = stringWidth + 8;
Insets i = c.getInsets();
if (i!=null) {
d.width += i.left + i.right;
}
if (border != null) {
i = border.getBorderInsets(c);
d.width += i.left + i.right;
}
return d;
}
return null;
}
protected JComponent createComponent() {
LayoutManager manager = createLayoutManager();
JPanel panel = new JPanel();
panel.setLayout(manager);
panel.setBorder(BorderFactory.createTitledBorder(filterName));
addCheckBoxes(panel);
return createFilterPanel(panel);
}
public AbstractScriptPanel(final LayoutManager layout) {
super(layout);
languageBox = new LanguageBox(getManager());
languageBox.addActionListener(new InternalLanguageBoxListener());
m_inputPane.setEditable(true);
m_inputPane.setBackground(new Color((float) .97, (float) .97, 1));
m_inputPane.setFont(new Font(GuiHelper.getMonospaceFont(), 0, 13));
m_OutputPane.setDocument(m_PythonStdoutDocument);
m_OutputPane.setEditable(false);
m_OutputPane.setBackground(new Color((float) .97, (float) .97, 1));
final JScrollPane inputScrollPane = new JScrollPane(m_inputPane);
final TitledBorder inputAreaBorder =
new TitledBorder(new LineBorder(Color.LIGHT_GRAY, 1, true), "Command Line");
inputScrollPane.setBorder(inputAreaBorder);
inputScrollPane.setPreferredSize(new Dimension(600, 200));
final JScrollPane m_OutputScrollPane = new JScrollPane(m_OutputPane);
final TitledBorder outputAreaBorder =
new TitledBorder(new LineBorder(Color.LIGHT_GRAY, 1, true), "Output");
m_OutputScrollPane.setBorder(outputAreaBorder);
m_OutputScrollPane.setPreferredSize(new Dimension(600, 200));
add(languageBox, BorderLayout.NORTH);
add(new JSplitPane(JSplitPane.VERTICAL_SPLIT, false, inputScrollPane, m_OutputScrollPane));
}
public void setLayout(LayoutManager mgr) {
LayoutManager oldMgr = getLayout();
if (oldMgr instanceof PropertyChangeListener) {
removePropertyChangeListener((PropertyChangeListener)oldMgr);
}
super.setLayout(mgr);
}
public void setLayout(LayoutManager mgr) {
LayoutManager oldMgr = getLayout();
if (oldMgr instanceof PropertyChangeListener) {
removePropertyChangeListener((PropertyChangeListener)oldMgr);
}
super.setLayout(mgr);
}
public void setLayout(LayoutManager mgr) {
LayoutManager oldMgr = getLayout();
if (oldMgr instanceof PropertyChangeListener) {
removePropertyChangeListener((PropertyChangeListener)oldMgr);
}
super.setLayout(mgr);
}
public void setLayout(LayoutManager mgr) {
LayoutManager oldMgr = getLayout();
if (oldMgr instanceof PropertyChangeListener) {
removePropertyChangeListener((PropertyChangeListener)oldMgr);
}
super.setLayout(mgr);
}
public String getToolBarPosition() {
LayoutManager layout = getContentPane().getLayout();
if (layout instanceof LizzieLayout) {
Lizzie.config.toolbarPosition = (String) ((LizzieLayout) layout).getConstraints(toolBar);
} else if (layout instanceof BorderLayout) {
Lizzie.config.toolbarPosition = (String) ((BorderLayout) layout).getConstraints(toolBar);
}
return Lizzie.config.toolbarPosition;
}
/**
* Adds a component to a panel with a grid bag layout.
*
* @param panel the panel to which to add the component
* @param comp the component to be added
* @param gbc the grid bag constraints to be used, can be <code>null</code> if <code>code</code> is not
* <code>null</code>
*/
public static void addToPanel(JPanel panel, Component comp, GridBagConstraints gbc) {
LayoutManager layoutManager = panel.getLayout();
if (!(layoutManager instanceof GridBagLayout)) {
throw new IllegalArgumentException("'panel' does not have a GridBagLayout manager");
}
GridBagLayout gbl = (GridBagLayout) layoutManager;
gbl.setConstraints(comp, gbc);
panel.add(comp);
}
@Override
public void setLayout(LayoutManager mgr) {
if (initialized) {
contentPane.setLayout(mgr);
} else {
super.setLayout(mgr);
}
}
public Dimension getPreferredSize(JComponent c) {
LayoutManager layout = c.getLayout();
Dimension d = layout.preferredLayoutSize(c);
String title = ((JPopupMenu)c).getLabel();
if (titleFont == null) {
UIDefaults table = UIManager.getLookAndFeelDefaults();
titleFont = table.getFont("PopupMenu.font");
}
FontMetrics fm = c.getFontMetrics(titleFont);
int stringWidth = 0;
if (title!=null) {
stringWidth += SwingUtilities2.stringWidth(c, fm, title);
}
if (d.width < stringWidth) {
d.width = stringWidth + 8;
Insets i = c.getInsets();
if (i!=null) {
d.width += i.left + i.right;
}
if (border != null) {
i = border.getBorderInsets(c);
d.width += i.left + i.right;
}
return d;
}
return null;
}
public Dimension getPreferredSize(JComponent c) {
LayoutManager layout = c.getLayout();
Dimension d = layout.preferredLayoutSize(c);
String title = ((JPopupMenu)c).getLabel();
if (titleFont == null) {
UIDefaults table = UIManager.getLookAndFeelDefaults();
titleFont = table.getFont("PopupMenu.font");
}
FontMetrics fm = c.getFontMetrics(titleFont);
int stringWidth = 0;
if (title!=null) {
stringWidth += SwingUtilities2.stringWidth(c, fm, title);
}
if (d.width < stringWidth) {
d.width = stringWidth + 8;
Insets i = c.getInsets();
if (i!=null) {
d.width += i.left + i.right;
}
if (border != null) {
i = border.getBorderInsets(c);
d.width += i.left + i.right;
}
return d;
}
return null;
}
public void PopuleBarra(JComponent obj) {
ButtonGroup buttons = new ButtonGroup();
Barra = obj;
Acao ac = new Acao(editor, "?", "Controler.interface.BarraLateral.Nothing.img", "Controler.interface.BarraLateral.Nothing.Texto", null);
JToggleButton btn = arrume(new JToggleButton(ac));
buttons.add(btn);
obj.add(btn);
btn.setSelected(true);
ac.IDX = -1;
this.BtnNothing = btn;
int i = 0;
for (ConfigAcao ca : Lista) {
if (ca.tipo == TipoConfigAcao.tpBotoes || ca.tipo == TipoConfigAcao.tpAny) {
ac = new Acao(editor, ca.texto, ca.ico, ca.descricao, ca.command);
ac.IDX = i++;
btn = arrume(new JToggleButton(ac));
buttons.add(btn);
//obj.add(btn);
listaBotoes.put(ca.command, btn);
}
}
menuComandos c = menuComandos.cmdDel;
String str = "Controler.comandos." + c.toString().substring(3).toLowerCase();
ac = new Acao(editor, Editor.fromConfiguracao.getValor(str + ".descricao"), str + ".img", str + ".descricao", c.toString());
ListaDeAcoesEditaveis.add(ac);
ac.normal = false;
JButton btn2 = new JButton(ac);
btn2.setHideActionText(true);
btn2.setFocusable(false);
btn2.setPreferredSize(new Dimension(40, 40));
obj.add(btn2);
LayoutManager la = obj.getLayout();
if (la instanceof GridLayout) {
((GridLayout) la).setRows(i + 2);
}
}
/**
* Creates a standard panel with a drop shadow.
*
* @param layout The layout to use.
* @param title The title to use.
* @param font The font to use for the title.
* @param onlyReportPreferredSize Whether or not minimum and maximum size is reported as
* preferred size or not.
*/
public DropPanel(LayoutManager layout, String title, Font font, boolean onlyReportPreferredSize) {
super(layout);
setOpaque(true);
setBackground(Color.WHITE);
mTitledBorder = new TitledBorder(font, title);
setBorder(new CompoundBorder(mTitledBorder, new EmptyBorder(0, 2, 1, 2)));
setAlignmentY(TOP_ALIGNMENT);
mOnlyReportPreferredSize = onlyReportPreferredSize;
}
public RoundedPanel(LayoutManager layout, int cornerRadius) {
super(layout);
this.cornerRadius = cornerRadius;
this.roundBounds = new RoundRectangle2D.Float(0,0,0,0,
cornerRadius, cornerRadius);
this.contentAreaFilled = true;
setOpaque(false);
}
public Dimension getPreferredSize(JComponent c) {
LayoutManager layout = c.getLayout();
Dimension d = layout.preferredLayoutSize(c);
String title = ((JPopupMenu)c).getLabel();
if (titleFont == null) {
UIDefaults table = UIManager.getLookAndFeelDefaults();
titleFont = table.getFont("PopupMenu.font");
}
FontMetrics fm = c.getFontMetrics(titleFont);
int stringWidth = 0;
if (title!=null) {
stringWidth += SwingUtilities2.stringWidth(c, fm, title);
}
if (d.width < stringWidth) {
d.width = stringWidth + 8;
Insets i = c.getInsets();
if (i!=null) {
d.width += i.left + i.right;
}
if (border != null) {
i = border.getBorderInsets(c);
d.width += i.left + i.right;
}
return d;
}
return null;
}