/** * Creates a panel. * * @param layout * the layout to apply to the panel. * @return the created panel. */ protected SPanel createSPanel(SLayoutManager layout) { SPanel panel = new SPanel(layout); panel.setPreferredSize(SDimension.FULLAREA); panel.setHorizontalAlignment(SConstants.LEFT_ALIGN); panel.setVerticalAlignment(SConstants.TOP_ALIGN); return panel; }
protected void initializeContentPane() { setContentPane(new SPanel(new SBorderLayout())); }
/** * Creates a panel. * * @param layout * the layout to apply to the panel. * @return the created panel. */ protected SPanel createSPanel(SLayoutManager layout) { SPanel panel = new SPanel(layout); panel.setPreferredSize(SDimension.FULLAREA); panel.setHorizontalAlignment(SConstants.LEFT_ALIGN); panel.setVerticalAlignment(SConstants.TOP_ALIGN); return panel; }
/** * 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)); }
public void setOptions(Object... options) { resetOptions(); Object[] oldVal = this.options; if (customButtons == null) customButtons = new SPanel(); for (Object option : options) { if (option instanceof SComponent) { if (option instanceof SAbstractButton) ((SAbstractButton) option).addActionListener(this); customButtons.add((SComponent) option); } else { SButton b = new SButton(option.toString()); b.addActionListener(this); customButtons.add(b); } } add(customButtons); propertyChangeSupport.firePropertyChange("options", oldVal, this.options); }
@Override public void executeTag(ParseContext context, Reader input) throws Exception { IntegrationTemplateParseContext tcontext = (IntegrationTemplateParseContext) context; Device sink = tcontext.getDevice(); /* * get the component that is associated with this name. This has * been set as Layout Manager Constraint. */ SComponent[] components = tcontext.getComponents(); StringBuilder sb = new StringBuilder(); for (long i = getTagLength(); i > 0; i--) { sb.append((char) input.read()); } SPanel container = new SPanel(new SFlowDownLayout()); for (SComponent c : components) { XDivision division = new XDivision(); division.add(c); container.add(division); } container.write(sink); }
/** * Determine wether the contentPane shall be an SForm. The property is true by default. * @param contentPaneForm <code>true</code> if the contentPane shall be an SForm, <code>false</code> otherwise */ public void setFormContentPane(boolean contentPaneForm) { if (contentPane instanceof SForm && !contentPaneForm) { SPanel newPanel = new SPanel(); rebuildPanel(contentPane, newPanel); setContentPane(newPanel); } else if (!(contentPane instanceof SForm) && contentPaneForm) { SForm newPanel = new SForm(); rebuildPanel(contentPane, newPanel); setContentPane(newPanel); } }
static void addCompForBorder(SBorder border, String description, SContainer container) { SPanel comp = new SPanel(new SGridLayout(1, 1)); SLabel label = new SLabel(description, SConstants.CENTER); comp.add(label); comp.setBorder(border); // container.add(Box.createRigidArea(new Dimension(0, 10))); container.add(comp); }
SPanel pane = new SPanel(new SGridBagLayout()); detailsScrollPane.setMode(SScrollPane.MODE_COMPLETE); detailsScrollPane.setPreferredSize(new SDimension(10, 250)); detailsPanel = new SPanel(new SGridBagLayout()); detailsPanel.add(detailsScrollPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6,
private SFrame createControllerFrame() { SFrame frame = new SFrame(); frame .setPreferredSize(new SDimension(frameWidth, frameHeight/* WingsUtil.FULL_DIM_PERCENT */)); cardPanel = new SPanel(new SCardLayout()); cardPanel.setPreferredSize(SDimension.FULLAREA); frame.getContentPane().add(createApplicationMenuBar(), SBorderLayout.NORTH); frame.getContentPane().add(cardPanel, SBorderLayout.CENTER); frame.getContentPane().setPreferredSize(SDimension.FULLAREA); return frame; }
SPanel actionPanel = new SPanel(); actionPanel.setLayout(new SBoxLayout(actionPanel, SBoxLayout.X_AXIS)); actionPanel.add(okButton); actionPanel.add(restoreButton); SPanel mainPanel = new SPanel(new SBorderLayout()); mainPanel.add(colorPicker, SBorderLayout.CENTER); mainPanel.add(actionPanel, SBorderLayout.SOUTH);
SPanel buttonBox = new SPanel(); buttonBox.setLayout(new SBoxLayout(dialog, SBoxLayout.X_AXIS)); buttonBox.setBorder(new SEmptyBorder(new java.awt.Insets(5, 10, 5, 10))); SPanel actionPanel = new SPanel(new SBorderLayout()); actionPanel.add(buttonBox, SBorderLayout.EAST); SPanel mainPanel = new SPanel(new SBorderLayout()); if (dimension != null) { mainView.setPreferredSize(new SDimension(dimension.getWidth() + "px",
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))); SPanel actionPanel = new SPanel(new SBorderLayout()); actionPanel.add(buttonBox, SBorderLayout.EAST); SPanel mainPanel = new SPanel(new SBorderLayout()); mainPanel.add(mainView.getPeer(), SBorderLayout.CENTER); mainPanel.add(actionPanel, SBorderLayout.SOUTH);
private void createControllerFrame() { controllerFrame = new SFrame(); String w = "95%"; String h = "768px"; if (getFrameWidth() != null) { w = getFrameWidth().intValue() + "px"; } if (getFrameHeight() != null) { h = getFrameHeight().intValue() + "px"; } controllerFrame.setPreferredSize(new SDimension(w, h)); controllerFrame.getContentPane().setPreferredSize(SDimension.FULLAREA); cardPanel = new SPanel(new SCardLayout()); cardPanel.setPreferredSize(SDimension.FULLAREA); controllerFrame.getContentPane().add(cardPanel, SBorderLayout.CENTER); statusBar = new SLabel(); statusBar.setBorder(new SLineBorder(1)); statusBar.setVisible(false); controllerFrame.getContentPane().add(statusBar, BorderLayout.SOUTH); updateFrameTitle(); controllerFrame.setVisible(true); }
SPanel workspaceView = new SPanel(new SGridBagLayout()); workspaceView.setPreferredSize(SDimension.FULLAREA);
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))); dialog.setDefaultButton(loginButton); SPanel actionPanel = new SPanel(new SBorderLayout()); actionPanel.add(buttonBox, SBorderLayout.EAST); SPanel mainPanel = new SPanel(new SBorderLayout()); mainPanel.add( new SLabel(getTranslation(
@Override public void activateExample() { SGridLayout layout = new SGridLayout(1, 0); panel = new SPanel( layout ); SPanel simpleBorders = new SPanel(); simpleBorders.setBorder(paneEdge); simpleBorders.setLayout(new SBoxLayout(null, SBoxLayout.Y_AXIS)); SPanel matteBorders = new SPanel(); matteBorders.setBorder(paneEdge); matteBorders.setLayout(new SBoxLayout(null, SBoxLayout.Y_AXIS)); "wavy-line border icon"); //20x22 SPanel titledBorders = new SPanel(); titledBorders.setBorder(paneEdge); titledBorders.setLayout(new SBoxLayout(null, SBoxLayout.Y_AXIS)); SPanel compoundBorders = new SPanel(); compoundBorders.setBorder(paneEdge); compoundBorders.setLayout(new SBoxLayout(null, SBoxLayout.Y_AXIS));