/** * create a new SToolBar. */ public SToolBar() { super(new SBoxLayout(null, SBoxLayout.HORIZONTAL)); }
/** * @param d the device to write the code to * @param l the layout manager * @throws IOException */ @Override public void write(Device d, SLayoutManager l) throws IOException { final SBoxLayout layout = (SBoxLayout) l; final List components = layout.getComponents(); final int cols = layout.getOrientation() == SBoxLayout.HORIZONTAL ? components.size() : 1; final TableCellStyle styles = cellLayoutStyle(layout); openLayouterBody(d, layout); printLayouterTableBody(d, layout.getContainer(), cols, components, styles); closeLayouterBody(d, layout); }
@Override protected int getLayoutHGap(SLayoutManager layout) { SBoxLayout boxLayout = (SBoxLayout) layout; return boxLayout.getHgap(); }
@Override protected int getLayoutBorder(SLayoutManager layout) { SBoxLayout boxLayout = (SBoxLayout) layout; return boxLayout.getBorder(); }
public EditorPanel() { super(new SBoxLayout(null, SBoxLayout.HORIZONTAL)); }
/** * Constructs a new <code>SActionField</code> instance. * * @param showTextField * is the text field visible to the user. */ public SActionField(boolean showTextField) { super(new SGridBagLayout()); textField = new STextField(); if (showTextField) { add(textField, new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets( 0, 0, 0, 0), 0, 0)); textField.setPreferredSize(SDimension.FULLWIDTH); } this.showTextField = showTextField; buttonPanel = new SPanel(); buttonPanel.setLayout(new SBoxLayout(buttonPanel, SBoxLayout.X_AXIS)); int buttonPosition; if (showTextField) { buttonPosition = 1; } else { buttonPosition = 0; } add(buttonPanel, new GridBagConstraints(buttonPosition, 0, 1, 1, 0, 1, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0)); }
/** * creates a new container with a Flowlayout as layout manager, like the * Swing default. */ public SContainer() { // init defaultLayout if not initialized yet if (defaultLayout == null) { // lookup the default Layout Behaviour final CGManager manager = getSession().getCGManager(); defaultLayout = (String) manager.getObject("SContainer.defaultLayoutBehaviour", String.class); } SLayoutManager layout = null; if (defaultLayout == null) { layout = new SFlowLayout(); } else if ("classic".equals(defaultLayout.toLowerCase())) { layout = new SBoxLayout(null, SBoxLayout.VERTICAL); } else if ("standard".equals(defaultLayout.toLowerCase())) { layout = new SFlowLayout(); } else if ("none".equals(defaultLayout.toLowerCase())) { layout = new SNullLayout(); } else { // fallback layout = new SFlowLayout(); } setLayout(layout); }
/** * Creates a tool bar. * * @return the created tool bar. */ protected SToolBar createSToolBar() { SToolBar toolBar = new SToolBar(); SBoxLayout toolBarLayout = new SBoxLayout(toolBar, SConstants.LEFT_ALIGN); toolBar.setLayout(toolBarLayout); SBevelBorder toolBarBorder = new SBevelBorder(SBevelBorder.RAISED, new Insets(2, 2, 2, 2), 2); toolBarBorder.setColor(Color.LIGHT_GRAY); toolBar.setBorder(toolBarBorder); // toolBar.setPreferredSize(SDimension.FULLWIDTH); toolBar.setHorizontalAlignment(SConstants.LEFT_ALIGN); return toolBar; }
/** * Creates a tool bar. * * @return the created tool bar. */ protected SToolBar createSToolBar() { SToolBar toolBar = new SToolBar(); SBoxLayout toolBarLayout = new SBoxLayout(toolBar, SConstants.LEFT_ALIGN); toolBar.setLayout(toolBarLayout); SBevelBorder toolBarBorder = new SBevelBorder(SBevelBorder.RAISED, new Insets(2, 2, 2, 2), 2); toolBarBorder.setColor(Color.LIGHT_GRAY); toolBar.setBorder(toolBarBorder); // toolBar.setPreferredSize(SDimension.FULLWIDTH); toolBar.setHorizontalAlignment(SConstants.LEFT_ALIGN); return toolBar; }
dialog.setDraggable(true); SPanel buttonBox = new SPanel(new SBoxLayout(dialog, SBoxLayout.X_AXIS)); buttonBox.setBorder(new SEmptyBorder(new java.awt.Insets(5, 10, 5, 10)));
actionPanel.setLayout(new SBoxLayout(actionPanel, SBoxLayout.X_AXIS)); actionPanel.add(okButton); actionPanel.add(cancelButton);
/** * Constructs a new <code>SColorPicker</code> instance. */ public SColorPicker() { setLayout(new SBoxLayout(this, SBoxLayout.X_AXIS)); chooseButton = new SButton(); chooseButton.addActionListener(new ActionListener() { public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { showColorPickerDialog(); } }); chooseButton.setShowAsFormComponent(false); chooseButton.setPreferredSize(BUTTON_DIM); chooseButton.setBorder(SBorderFactory.createSLineBorder(Color.GRAY)); resetButton = new SButton(); resetButton.addActionListener(new ActionListener() { public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { setValue(resetValue); } }); resetButton.setShowAsFormComponent(false); resetButton.setPreferredSize(BUTTON_DIM); resetButton.setBorder(SBorderFactory.createSLineBorder(Color.GRAY)); add(chooseButton); add(resetButton); }
dialog.setDraggable(true); SPanel buttonBox = new SPanel(new SBoxLayout(dialog, SBoxLayout.X_AXIS)); buttonBox.setBorder(new SEmptyBorder(new java.awt.Insets(5, 10, 5, 10)));
new SBoxLayout(buttonPanel, SBoxLayout.X_AXIS));
simpleBorders.setLayout(new SBoxLayout(null, SBoxLayout.Y_AXIS)); matteBorders.setLayout(new SBoxLayout(null, SBoxLayout.Y_AXIS)); titledBorders.setLayout(new SBoxLayout(null, SBoxLayout.Y_AXIS)); compoundBorders.setLayout(new SBoxLayout(null, SBoxLayout.Y_AXIS)); SBorder redline = SBorderFactory.createSLineBorder(Color.red);
buttonBox.setLayout(new SBoxLayout(dialog, SBoxLayout.X_AXIS)); buttonBox.setBorder(new SEmptyBorder(new java.awt.Insets(5, 10, 5, 10)));