Java Code Examples for javax.swing.border.EtchedBorder

The following are top voted examples for showing how to use javax.swing.border.EtchedBorder. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: incubator-netbeans   File: EtchedBorderBeanInfo.java   Source Code and License 6 votes vote down vote up
public EtchTypePropertyEditor() {
    super(
        new int[] {
            EtchedBorder.LOWERED,
            EtchedBorder.RAISED,
        },
        new String[] {
            "javax.swing.border.EtchedBorder.LOWERED", // NOI18N
            "javax.swing.border.EtchedBorder.RAISED" // NOI18N
        },
        new String[] {
            "VALUE_EtchLowered", // NOI18N
            "VALUE_EtchRaised", // NOI18N
        }
    );
}
 
Example 2
Project: incubator-netbeans   File: BorderBuilders.java   Source Code and License 6 votes vote down vote up
static BorderBuilder fromField(Instance instance, String field, boolean uiresource, Heap heap) {
    Object _border = instance.getValueOfField(field);
    if (!(_border instanceof Instance)) return null;

    Instance border = (Instance)_border;

    // Make sure subclasses are listed before base class if using isSubclassOf
    if (DetailsUtils.isSubclassOf(border, BevelBorder.class.getName())) {
        return new BevelBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, MatteBorder.class.getName())) { // Must be before EmptyBorder (extends EmptyBorder)
        return new EmptyBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, EmptyBorder.class.getName())) {
        return new MatteBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, EtchedBorder.class.getName())) {
        return new EtchedBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, LineBorder.class.getName())) {
        return new LineBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, TitledBorder.class.getName())) {
        return new TitledBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, CompoundBorder.class.getName())) {
        return new CompoundBorderBuilder(border, heap);
    }

    return null;
}
 
Example 3
Project: AgentWorkbench   File: MaximizedTab.java   Source Code and License 6 votes vote down vote up
/**
	 * Initialize.
	 */
	private void initialize() {
		
		this.setClosable(true);
		this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
		this.setVisible(true);
		this.registerEscapeKeyStroke();
		this.addInternalFrameListener(new InternalFrameAdapter() {
			/* (non-Javadoc)
			 * @see javax.swing.event.InternalFrameAdapter#internalFrameClosing(javax.swing.event.InternalFrameEvent)
			 */
			@Override
			public void internalFrameClosing(InternalFrameEvent ife) {
				projectWindow.tabRestore();
				super.internalFrameClosing(ife);
			}
			/* (non-Javadoc)
			 * @see javax.swing.event.InternalFrameAdapter#internalFrameDeactivated(javax.swing.event.InternalFrameEvent)
			 */
			@Override
			public void internalFrameDeactivated(InternalFrameEvent e) {
//				projectWindow.tabRestore();
				super.internalFrameDeactivated(e);
			}
			
		});
		((BasicInternalFrameUI) this.getUI()).setNorthPane(null);
	
		// --- Add ComponentListener to MainWindow -------- 
		this.addComponentListenerOfMainWindow();
		
	}
 
Example 4
Project: jmt   File: KMeanScatterPanelChoose.java   Source Code and License 6 votes vote down vote up
public KMeanScatterPanelChoose(WorkloadAnalysisSession m) {
	super(new BorderLayout());
	setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED), "Scatter Clustering"));

	model = (ModelWorkloadAnalysis) m.getDataModel();
	this.session = m;

	varXCombo = new JComboBox(model.getMatrix().getVariableNames());
	varYCombo = new JComboBox(model.getMatrix().getVariableNames());
	varXCombo.setSelectedIndex(0);
	varYCombo.setSelectedIndex(1);

	JButton vis = new JButton(VIS_SCATTER);

	JPanel combos = new JPanel(new GridLayout(1, 2, 5, 0));
	combos.add(varXCombo);
	combos.add(varYCombo);

	add(combos, BorderLayout.NORTH);
	add(vis, BorderLayout.SOUTH);
}
 
Example 5
Project: jmt   File: ClassSwitchSectionPanel.java   Source Code and License 6 votes vote down vote up
protected void initComponents() {
	removeAll();
	setLayout(new BorderLayout());

	WarningScrollTable wST = new WarningScrollTable(csTable, WARNING_CLASS);
	setBorder(new TitledBorder(new EtchedBorder(), "CS Strategies"));
	setMinimumSize(new Dimension(180, 100));
	descriptionLabel = new JLabel(DESCRIPTION);
	normalizzationErrorLabel = new JLabel(NORMALIZATION_ERROR);
	normalizzationWarningLabel = new JLabel(NORMALIZATION_WARNING);
	checkRowLessThanOne();
	add(wST, BorderLayout.CENTER);
	add(descriptionLabel, BorderLayout.SOUTH);
	JPanel msgPanel = new JPanel(new BorderLayout());
	msgPanel.add(normalizzationErrorLabel, BorderLayout.NORTH);
	msgPanel.add(normalizzationWarningLabel, BorderLayout.SOUTH);
	add(msgPanel, BorderLayout.NORTH);
	if (descriptionLabel != null) {
		descriptionLabel.setVisible(classData.getClassKeys().size() != 0);
	}
}
 
Example 6
Project: jmt   File: BlockingRegionParameterPanel.java   Source Code and License 6 votes vote down vote up
/**
 * Sets data for this panel
 * @param cd class definition data structure
 * @param brd blocking region definition data structure
 * @param key search's key for given blocking region
 */
public void setData(ClassDefinition cd, BlockingRegionDefinition brd, Object key) {
	this.cd = cd;
	this.brd = brd;
	this.key = key;

	mainPanel.removeAll();
	mainPanel.setBorder(BorderFactory.createTitledBorder(new EtchedBorder(), "Specific Properties of " + brd.getRegionName(key)));
	if (classTablePanel == null) {
		classTablePanel = new BlockingRegionClassPanel(cd, brd, key);
	} else {
		classTablePanel.setData(cd, brd, key);
	}
	if (groupTablePanel == null) {
		groupTablePanel = new BlockingRegionGroupPanel(cd, brd, key, gNumber);
	} else {
		groupTablePanel.setData(cd, brd, key);
	}
	mainPanel.add(classTablePanel, "Class Specific");
	mainPanel.add(groupTablePanel, "Group Specific");

	current = (WizardPanel) mainPanel.getSelectedComponent();
	updateData();
}
 
Example 7
Project: jmt   File: JoinSectionPanel.java   Source Code and License 6 votes vote down vote up
private void initComponents() {
	this.setLayout(new BorderLayout());
	//building mainPanel
	mainPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
	mainPanel.setDividerSize(4);
	mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
	//layout of main panel
	WarningScrollTable jsp = new WarningScrollTable(joinStrategies, WARNING_CLASS);
	jsp.setBorder(new TitledBorder(new EtchedBorder(), "Join Strategies"));
	mainPanel.setResizeWeight(1.0);
	jsp.setMinimumSize(new Dimension(200, 100));
	mainPanel.setLeftComponent(jsp);
	joinEditor.setMinimumSize(new Dimension(225, 100));
	mainPanel.setRightComponent(joinEditor);
	add(mainPanel, BorderLayout.CENTER);
}
 
Example 8
Project: jmt   File: StorageSectionPanel.java   Source Code and License 6 votes vote down vote up
private void initComponents() {
	setLayout(new BorderLayout(5, 5));
	setBorder(new EmptyBorder(5, 5, 5, 5));

	capacitySpinner = new JSpinner();
	capacitySpinner.setPreferredSize(DIM_BUTTON_XS);
	infiniteCheckBox = new JCheckBox("Infinite");
	JPanel capacityPanel = new JPanel();
	capacityPanel.setBorder(new TitledBorder(new EtchedBorder(), "Storage Capacity"));
	capacityPanel.add(new JLabel("Capacity: "));
	capacityPanel.add(capacitySpinner);
	capacityPanel.add(infiniteCheckBox);

	optionTable = new StorageOptionTable();
	JPanel optionPanel = new JPanel(new BorderLayout());
	optionPanel.setBorder(new TitledBorder(new EtchedBorder(), "Storage Options"));
	optionPanel.add(new WarningScrollTable(optionTable, WARNING_CLASS));

	add(capacityPanel, BorderLayout.NORTH);
	add(optionPanel, BorderLayout.CENTER);
}
 
Example 9
Project: jmt   File: SemaphoreSectionPanel.java   Source Code and License 6 votes vote down vote up
private void initComponents() {
	this.setLayout(new BorderLayout());
	//building mainPanel
	mainPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
	mainPanel.setDividerSize(4);
	mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
	//layout of main panel
	WarningScrollTable jsp = new WarningScrollTable(semaphoreStrategies, WARNING_CLASS);
	jsp.setBorder(new TitledBorder(new EtchedBorder(), "Semaphore Strategies"));
	mainPanel.setResizeWeight(1.0);
	jsp.setMinimumSize(new Dimension(200, 100));
	mainPanel.setLeftComponent(jsp);
	semaphoreEditor.setMinimumSize(new Dimension(225, 100));
	mainPanel.setRightComponent(semaphoreEditor);
	add(mainPanel, BorderLayout.CENTER);
}
 
Example 10
Project: jmt   File: RoutingSectionPanel.java   Source Code and License 6 votes vote down vote up
protected void initComponents() {
	this.setLayout(new BorderLayout());
	//building mainPanel
	mainPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
	mainPanel.setDividerSize(4);
	mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
	//layout of main panel
	WarningScrollTable jsp = new WarningScrollTable(routingStrategies, WARNING_CLASS);
	jsp.setBorder(new TitledBorder(new EtchedBorder(), "Routing Strategies"));
	mainPanel.setResizeWeight(1.0);
	jsp.setMinimumSize(new Dimension(200, 100));
	mainPanel.setLeftComponent(jsp);
	routingProbEditor.setMinimumSize(new Dimension(225, 100));
	mainPanel.setRightComponent(routingProbEditor);
	add(mainPanel, BorderLayout.CENTER);
}
 
Example 11
Project: jmt   File: SemaphoreEditor.java   Source Code and License 6 votes vote down vote up
private void initComponents() {
	mixPane = new WarningScrollTable(mixTable, WARNING_CLASS);
	mixPane.setBorder(new TitledBorder(new EtchedBorder(), "Semaphore Options"));
	noOptLabelPanel.setBorder(new TitledBorder(new EtchedBorder(), "Semaphore Options"));
	noOptLabel.setOpaque(false);
	noOptLabel.setEditable(false);
	noOptLabel.setLineWrap(true);
	noOptLabel.setWrapStyleWord(true);
	descrTextPane.setOpaque(false);
	descrTextPane.setEditable(false);
	descrTextPane.setLineWrap(true);
	descrTextPane.setWrapStyleWord(true);
	descrPane.setBorder(new TitledBorder(new EtchedBorder(), "Description"));
	descrPane.setViewportView(descrTextPane);
	semaphorePane.setLayout(new FlowLayout());
	JLabel text = new JLabel("Number of Required Tasks:");
	jNumField.setPreferredSize(DIM_BUTTON_XS);
	semaphorePane.add(text);
	semaphorePane.add(jNumField);
	semaphorePane.setBorder(new TitledBorder(new EtchedBorder(), "Semaphore Options"));
	setLeftComponent(descrPane);
}
 
Example 12
Project: jmt   File: RoutingProbabilitiesEditor.java   Source Code and License 6 votes vote down vote up
private void initComponents() {
	rtPane = new WarningScrollTable(routingTable, WARNING_OUTGOING_ROUTING);
	noOptLabelPanel.setBorder(new TitledBorder(new EtchedBorder(), "Routing Options"));
	noOptLabel.setOpaque(false);
	noOptLabel.setEditable(false);
	noOptLabel.setLineWrap(true);
	noOptLabel.setWrapStyleWord(true);
	rtPane.setBorder(new TitledBorder(new EtchedBorder(), "Routing Options"));
	descrTextPane.setOpaque(false);
	descrTextPane.setEditable(false);
	descrTextPane.setLineWrap(true);
	descrTextPane.setWrapStyleWord(true);
	descrPane.setBorder(new TitledBorder(new EtchedBorder(), "Description"));
	descrPane.setViewportView(descrTextPane);
	setLeftComponent(descrPane);
}
 
Example 13
Project: jmt   File: JoinEditor.java   Source Code and License 6 votes vote down vote up
private void initComponents() {
	mixPane = new WarningScrollTable(mixTable, WARNING_CLASS);
	mixPane.setBorder(new TitledBorder(new EtchedBorder(), "Join Options"));
	noOptLabelPanel.setBorder(new TitledBorder(new EtchedBorder(), "Join Options"));
	noOptLabel.setOpaque(false);
	noOptLabel.setEditable(false);
	noOptLabel.setLineWrap(true);
	noOptLabel.setWrapStyleWord(true);
	descrTextPane.setOpaque(false);
	descrTextPane.setEditable(false);
	descrTextPane.setLineWrap(true);
	descrTextPane.setWrapStyleWord(true);
	descrPane.setBorder(new TitledBorder(new EtchedBorder(), "Description"));
	descrPane.setViewportView(descrTextPane);
	joinPane.setLayout(new FlowLayout());
	JLabel text = new JLabel("Number of Required Tasks:");
	jNumField.setPreferredSize(DIM_BUTTON_XS);
	joinPane.add(text);
	joinPane.add(jNumField);
	joinPane.setBorder(new TitledBorder(new EtchedBorder(), "Join Options"));
	setLeftComponent(descrPane);
}
 
Example 14
Project: VASSAL-src   File: GlobalMap.java   Source Code and License 6 votes vote down vote up
public GlobalMap() {
  view = new View();
  view.addMouseListener(view);

  scroll = new GlobalMapScrollPane(view);
  scroll.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
  scroll.setAlignmentX(0.0f);
  scroll.setAlignmentY(0.0f);

  ActionListener al = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      scroll.setVisible(!scroll.isVisible());
    }
  };

  launch = new LaunchButton(null, TOOLTIP, BUTTON_TEXT,
                            HOTKEY, ICON_NAME, al);
  launch.setAttribute(TOOLTIP, "Show/Hide overview window");
  launch.setAttribute(HOTKEY,
    NamedKeyStroke.getNamedKeyStroke(KeyEvent.VK_O,
                           KeyEvent.CTRL_MASK + KeyEvent.SHIFT_MASK));
}
 
Example 15
Project: QN-ACTR-Release   File: KMeanScatterPanelChoose.java   Source Code and License 6 votes vote down vote up
public KMeanScatterPanelChoose(WorkloadAnalysisSession m) {
	super(new BorderLayout());
	setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED), "Scatter Clustering"));

	model = (ModelWorkloadAnalysis) m.getDataModel();
	this.session = m;

	varXCombo = new JComboBox(model.getMatrix().getVariableNames());
	varYCombo = new JComboBox(model.getMatrix().getVariableNames());
	varXCombo.setSelectedIndex(0);
	varYCombo.setSelectedIndex(1);

	JButton vis = new JButton(VIS_SCATTER);

	JPanel combos = new JPanel(new GridLayout(1, 2, 5, 0));
	combos.add(varXCombo);
	combos.add(varYCombo);

	add(combos, BorderLayout.NORTH);
	add(vis, BorderLayout.SOUTH);
}
 
Example 16
Project: QN-ACTR-Release   File: RoutingSectionPanel.java   Source Code and License 6 votes vote down vote up
protected void initComponents() {
	this.setLayout(new BorderLayout());
	//building mainPanel
	mainPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
	mainPanel.setDividerSize(4);
	mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
	//layout of main panel
	WarningScrollTable jsp = new WarningScrollTable(routingStrategies, WARNING_CLASS);
	//routing strategy selector on the left, routing probabilities editor on the right
	jsp.setBorder(new TitledBorder(new EtchedBorder(), "Routing Strategies"));
	mainPanel.setResizeWeight(.80); // Gives more space to left component
	jsp.setMinimumSize(new Dimension(180, 100));
	mainPanel.setLeftComponent(jsp);
	routingProbEditor.setMinimumSize(new Dimension(160, 100));
	mainPanel.setRightComponent(routingProbEditor);
	add(mainPanel, BorderLayout.CENTER);
}
 
Example 17
Project: QN-ACTR-Release   File: RoutingProbabilitiesEditor.java   Source Code and License 6 votes vote down vote up
private void initComponents() {
	rtPane = new WarningScrollTable(routingTable, WARNING_ROUTING);
	noOptLabelPanel.setBorder(new TitledBorder(new EtchedBorder(), "Routing Options"));
	noOptLabel.setOpaque(false);
	noOptLabel.setEditable(false);
	noOptLabel.setLineWrap(true);
	noOptLabel.setWrapStyleWord(true);
	rtPane.setBorder(new TitledBorder(new EtchedBorder(), "Routing Options"));
	descrTextPane.setOpaque(false);
	descrTextPane.setEditable(false);
	descrTextPane.setLineWrap(true);
	descrTextPane.setWrapStyleWord(true);
	descrPane.setBorder(new TitledBorder(new EtchedBorder(), "Description"));
	descrPane.setViewportView(descrTextPane);
	setLeftComponent(descrPane);
}
 
Example 18
Project: gate-core   File: Splash.java   Source Code and License 6 votes vote down vote up
/**
 * Constructor from owner, GraphicsConfiguration and content.
 */
public Splash(Window owner, GraphicsConfiguration gc, final JComponent content) {
  super(owner, gc);
  getContentPane().setLayout(new BorderLayout());
  content.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
  getContentPane().add(content, BorderLayout.CENTER);
  content.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
      // when the content pane is clicked, hide it
      setVisible(false);
    }
  });
  validate();
  pack();
}
 
Example 19
Project: zencash-swing-wallet-ui   File: AddressBookPanel.java   Source Code and License 6 votes vote down vote up
private JPanel buildButtonsPanel() {
    JPanel panel = new JPanel();
    panel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
    panel.setLayout(new FlowLayout(FlowLayout.CENTER, 3, 3));
    
    JButton newContactButton = new JButton("New contact...");
    newContactButton.addActionListener(new NewContactActionListener());
    panel.add(newContactButton);
            
    sendCashButton = new JButton("Send ZEN");
    sendCashButton.addActionListener(new SendCashActionListener());
    sendCashButton.setEnabled(false);
    panel.add(sendCashButton);
    
    copyToClipboardButton = new JButton("Copy address to clipboard");
    copyToClipboardButton.setEnabled(false);
    copyToClipboardButton.addActionListener(new CopyToClipboardActionListener());
    panel.add(copyToClipboardButton);
    
    deleteContactButton = new JButton("Delete contact");
    deleteContactButton.setEnabled(false);
    deleteContactButton.addActionListener(new DeleteAddressActionListener());
    panel.add(deleteContactButton);
    
    return panel;
}
 
Example 20
Project: komodoGUI   File: AddressBookPanel.java   Source Code and License 6 votes vote down vote up
private JPanel buildButtonsPanel() {
    JPanel panel = new JPanel();
    panel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
    panel.setLayout(new FlowLayout(FlowLayout.CENTER, 3, 3));

    JButton newContactButton = new JButton("New contact...");
    newContactButton.addActionListener(new NewContactActionListener());
    panel.add(newContactButton);

    sendCashButton = new JButton("Send KMD");
    sendCashButton.addActionListener(new SendCashActionListener());
    sendCashButton.setEnabled(false);
    panel.add(sendCashButton);

    copyToClipboardButton = new JButton("Copy address to clipboard");
    copyToClipboardButton.setEnabled(false);
    copyToClipboardButton.addActionListener(new CopyToClipboardActionListener());
    panel.add(copyToClipboardButton);

    deleteContactButton = new JButton("Delete contact");
    deleteContactButton.setEnabled(false);
    deleteContactButton.addActionListener(new DeleteAddressActionListener());
    panel.add(deleteContactButton);

    return panel;
}
 
Example 21
Project: incubator-netbeans   File: EtchedBorderBeanInfo.java   Source Code and License 5 votes vote down vote up
@Override
protected PropertyDescriptor[] createPropertyDescriptors() throws IntrospectionException {
    PropertyDescriptor[] pds = new PropertyDescriptor[] {
        createRO(EtchedBorder.class, "etchType"), // NOI18N
        createRO(EtchedBorder.class, "highlightColor"), // NOI18N
        createRO(EtchedBorder.class, "shadowColor"), // NOI18N
    };
    pds[0].setPropertyEditorClass(EtchTypePropertyEditor.class);
    return pds;
}
 
Example 22
Project: incubator-netbeans   File: TemplateWizard1.java   Source Code and License 5 votes vote down vote up
/** Prepares decription area with html browser inside.
 * Executed in other then event dispatch thread.
 */
public void construct() {
    initData = new InitData();
    initData.browser = new HtmlBrowser(false, false);
    initData.browser.setName("browser");
    initData.noDescMsg = NbBundle.getBundle(TemplateWizard1.class).
                        getString("MSG_NoDescription");
    initData.noDescBorder = new EtchedBorder();

    // override the Swing default CSS to make the HTMLEditorKit use the
    // same font as the rest of the UI
    
    Component comp = initData.browser.getBrowserComponent();
    if (! (comp instanceof javax.swing.JEditorPane))
        return;

    javax.swing.text.EditorKit kit = ((javax.swing.JEditorPane) comp).getEditorKitForContentType("text/html"); // NOI18N
    if (! (kit instanceof javax.swing.text.html.HTMLEditorKit))
        return;

    javax.swing.text.html.HTMLEditorKit htmlkit = (javax.swing.text.html.HTMLEditorKit) kit;

    // XXX the style sheet is shared by all HTMLEditorKits.  We must
    // detect if it has been tweaked by ourselves or someone else
    // (template description for example) and avoid doing the same
    // thing again
    
    if (htmlkit.getStyleSheet().getStyleSheets() != null)
        return;
    
    javax.swing.text.html.StyleSheet css = new javax.swing.text.html.StyleSheet();
    java.awt.Font f = new javax.swing.JTextArea().getFont();
    css.addRule(new StringBuffer("body { font-size: ").append(f.getSize()) // NOI18N
                .append("; font-family: ").append(f.getName()).append("; }").toString()); // NOI18N
    css.addStyleSheet(htmlkit.getStyleSheet());
    htmlkit.setStyleSheet(css);
}
 
Example 23
Project: incubator-netbeans   File: BorderBuilders.java   Source Code and License 5 votes vote down vote up
EtchedBorderBuilder(Instance instance, Heap heap) {
    super(instance, heap);
    
    etchType = DetailsUtils.getIntFieldValue(instance, "etchType", EtchedBorder.LOWERED);
    highlight = ColorBuilder.fromField(instance, "highlight", heap);
    shadow = ColorBuilder.fromField(instance, "shadow", heap);
}
 
Example 24
Project: incubator-netbeans   File: NbTheme.java   Source Code and License 5 votes vote down vote up
private final void handleEtchedBorder (org.xml.sax.AttributeList atts) {
    String key = atts.getValue (KEY_ATTR);
    int i = EtchedBorder.LOWERED;
    String type = atts.getValue (TYPE_ATTR);
    if (type != null) 
        i = type.equals (TYPE_LOWERED) ? EtchedBorder.LOWERED : EtchedBorder.RAISED;
    BorderUIResource.EtchedBorderUIResource resource = new BorderUIResource.EtchedBorderUIResource (i);
    defaults.put (key, resource);
}
 
Example 25
Project: AgentWorkbench   File: TimeSeriesWidget.java   Source Code and License 5 votes vote down vote up
/**
 * This method initializes this.
 */
private void initialize() {
       
	GridBagConstraints gridBagConstraints = new GridBagConstraints();
       gridBagConstraints.gridx = 0;
       gridBagConstraints.gridy = 0;
       
       this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
       this.setLayout(new GridBagLayout());
       this.add(getJButtonEdit(), gridBagConstraints);
		
}
 
Example 26
Project: AgentWorkbench   File: StartOptions.java   Source Code and License 5 votes vote down vote up
/**
 * This method initializes this
 * @return void
 */
private void initialize() {
	
	// --- Initiate all sub panels --------------------
	this.registerOptionPanel(this.getJPanelMasterConfiguration());
	this.registerOptionPanel(this.getJPanelOwnMTP());
	this.registerOptionPanel(this.getJPanelMTPConfig());
	this.registerOptionPanel(this.getJPanelBackgroundSystem());
	this.registerOptionPanel(this.getJPanelDatabase());
	this.registerOptionPanel(this.getJPanelEmbeddedSystemAgent());
	
	GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
	gridBagConstraints3.gridx = 0;
	gridBagConstraints3.fill = GridBagConstraints.BOTH;
	gridBagConstraints3.weightx = 1.0;
	gridBagConstraints3.weighty = 1.0;
	gridBagConstraints3.insets = new Insets(10, 10, 10, 10);
	gridBagConstraints3.gridy = 1;
	GridBagConstraints gridBagConstraints21 = new GridBagConstraints();
	gridBagConstraints21.gridx = 0;
	gridBagConstraints21.fill = GridBagConstraints.HORIZONTAL;
	gridBagConstraints21.insets = new Insets(20, 20, 0, 20);
	gridBagConstraints21.anchor = GridBagConstraints.WEST;
	gridBagConstraints21.weightx = 1.0;
	gridBagConstraints21.weighty = 0.0;
	gridBagConstraints21.gridy = 0;
	
	this.setSize(770, 440);
	this.setLayout(new GridBagLayout());
	this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
	this.add(this.getJPanelTop(), gridBagConstraints21);
	this.add(this.getJPanel4ScrollPane(), gridBagConstraints3);
	
}
 
Example 27
Project: AgentWorkbench   File: OntologieSelector.java   Source Code and License 5 votes vote down vote up
/**
 * This method initializes jPanelShowOptions	
 * @return javax.swing.JPanel	
 */
private JPanel getJPanelShowOptions() {
	if (jPanelShowOptions == null) {
		GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
		gridBagConstraints6.gridx = 0;
		gridBagConstraints6.insets = new Insets(0, 0, 0, 10);
		gridBagConstraints6.gridy = 0;
		
		GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
		gridBagConstraints5.gridx = 2;
		gridBagConstraints5.insets = new Insets(0, 0, 0, 10);
		gridBagConstraints5.gridy = 0;
		
		GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
		gridBagConstraints3.gridx = 1;
		gridBagConstraints3.insets = new Insets(0, 0, 0, 10);
		gridBagConstraints3.gridy = -1;
		
		jLabelShow = new JLabel();
		jLabelShow.setText("Ansicht:");
		jLabelShow.setFont(new Font("Dialog", Font.BOLD, 12));
		
		jPanelShowOptions = new JPanel();
		jPanelShowOptions.setLayout(new GridBagLayout());
		jPanelShowOptions.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
		jPanelShowOptions.setPreferredSize(new Dimension(366, 36));
		jPanelShowOptions.add(getJRadioButtonShowAll(), gridBagConstraints3);
		jPanelShowOptions.add(getJRadioButtonShowNoneJade(), gridBagConstraints5);
		jPanelShowOptions.add(jLabelShow, gridBagConstraints6);
		
		// --- Button-Group definieren --------------------------
		buttonGroup = new ButtonGroup();
		buttonGroup.add(jRadioButtonShowAll);
		buttonGroup.add(jRadioButtonShowNoneJade);
	}
	return jPanelShowOptions;
}
 
Example 28
Project: jmt   File: IterationSelector.java   Source Code and License 5 votes vote down vote up
/**
 * Initialize all gui objects
 */
private void initComponents() {
	setLayout(new BorderLayout());
	JPanel topPanel = new JPanel(new GridLayout(2, 1));
	topPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
	JLabel label = new JLabel("Execution number: ");
	final JSpinner spinner = new JSpinner();
	spinner.setPreferredSize(DIM_SPINNER);
	spinner.setValue(new Integer(1));
	label.setLabelFor(spinner);
	// Pack spinner and its label on top, while description is on the second line
	JPanel tmp = new JPanel();
	tmp.add(label);
	tmp.add(spinner);
	topPanel.add(tmp);
	description.setHorizontalAlignment(SwingConstants.CENTER);
	topPanel.add(description);
	// Adds state change to spinner.
	spinner.addChangeListener(new ChangeListener() {
		public void stateChanged(ChangeEvent e) {
			int i = ((Integer) spinner.getValue()).intValue();
			if (i <= 0) {
				i = 1;
			}
			if (i > model.getWhatIfValues().length) {
				i = model.getWhatIfValues().length;
			}
			select(i - 1);
			spinner.setValue(new Integer(i));
		}
	});

	add(topPanel, BorderLayout.NORTH);
	add(tabber, BorderLayout.CENTER);
	select(0);
}
 
Example 29
Project: jmt   File: BlockingStationPanel.java   Source Code and License 5 votes vote down vote up
/**
 * Sets data for this panel
 * @param cd class definition data structure
 * @param brd blocking region definition data structure
 * @param key search's key for given blocking region
 */
public void setData(ClassDefinition cd, StationDefinition sd, BlockingRegionDefinition brd, Object key) {
	this.cd = cd;
	this.sd = sd;
	this.bd = brd;
	this.regionKey = key;
	comboFactory.setData(sd);
	parameterPanel.setData(cd, brd, key);
	stationPanel.setBorder(BorderFactory.createTitledBorder(new EtchedBorder(), "Stations in " + bd.getRegionName(regionKey)));
}
 
Example 30
Project: jmt   File: BlockingStationPanel.java   Source Code and License 5 votes vote down vote up
/**
 * Initialize all gui related stuff
 */
private void initComponent() {
	setLayout(new GridLayout(2, 1));
	stationPanel = new JPanel(new BorderLayout(5, 5));
	stationPanel.setBorder(BorderFactory.createTitledBorder(new EtchedBorder(), "Stations in " + bd.getRegionName(regionKey)));

	// Creates panel with add station button and spinner
	JPanel addPanel = new JPanel(new BorderLayout());
	addStation = new JButton("Add Station");
	addStation.setToolTipText("Adds a station to selected blocking region");
	addStation.setMinimumSize(DIM_BUTTON_S);
	addPanel.add(addStation, BorderLayout.CENTER);
	//build spinner panel
	JPanel spinnerPanel = new JPanel();
	JLabel spinnerDescrLabel = new JLabel("Stations:");
	stationNumSpinner = new JSpinner();
	stationNumSpinner.setPreferredSize(DIM_BUTTON_XS);
	spinnerPanel.add(spinnerDescrLabel);
	spinnerPanel.add(stationNumSpinner);
	addPanel.add(spinnerPanel, BorderLayout.SOUTH);
	// Creates a tmp panel to put addStation panel on the northeast corner
	JPanel tmpPanel = new JPanel(new BorderLayout());
	tmpPanel.add(addPanel, BorderLayout.NORTH);
	stationPanel.add(tmpPanel, BorderLayout.EAST);
	// Creates table to display stations
	stationTable = new StationTable();
	warningPanel = new WarningScrollTable(stationTable, WARNING_STATION);
	warningPanel.addCheckVector(sd.getStationKeysNoSourceSink());
	stationPanel.add(warningPanel);
	add(stationPanel);

	// Creates the inner parameter panel
	parameterPanel = new BlockingRegionParameterPanel(cd, bd, regionKey);
	// Hides unneeded global properties (specified by table)
	parameterPanel.setGlobalVisible(false);
	add(parameterPanel);
}
 
Example 31
Project: jmt   File: StationNamePanel.java   Source Code and License 5 votes vote down vote up
/**
 * Inits this panel's components and their action listeners
 */
private void init() {
	setLayout(new BorderLayout(5, 5));
	setBorder(new TitledBorder(new EtchedBorder(), "Station Name"));
	add(new JLabel("Station Name: "), BorderLayout.WEST);
	name.setText(sd.getStationName(key));
	add(name, BorderLayout.CENTER);
	add(Box.createVerticalStrut(5), BorderLayout.SOUTH);
	inputListener listener = new inputListener();
	name.addKeyListener(listener);
	name.addFocusListener(listener);
}
 
Example 32
Project: jmt   File: InputSectionPanel.java   Source Code and License 5 votes vote down vote up
private void initComponents() {
	this.setBorder(new EmptyBorder(5, 5, 5, 5));
	this.setLayout(new BorderLayout(5, 5));
	infiniteQueueSelector = new JRadioButton("Infinite");
	finiteQueueSelector = new JRadioButton("Finite");
	queueLengthGroup = new ButtonGroup();
	queueLengthGroup.add(infiniteQueueSelector);
	queueLengthGroup.add(finiteQueueSelector);
	queueLengthSpinner = new JSpinner();
	queueLengthSpinner.setValue(new Integer(1));
	queueLengthSpinner.setPreferredSize(DIM_BUTTON_XS);
	queueTable = new QueueTable();

	//queue details panel
	JPanel queuePolicyPanel = new JPanel(new BorderLayout());
	queuePolicyPanel.setBorder(new TitledBorder(new EtchedBorder(), "Queue Policy"));
	queuePolicyPanel.add(new WarningScrollTable(queueTable, WARNING_CLASS), BorderLayout.CENTER);
	JPanel queueLengthPanel = new JPanel(new GridLayout(3, 1, 3, 3));
	queueLengthPanel.setBorder(new TitledBorder(new EtchedBorder(), "Capacity"));

	// Queue strategy selector
	JPanel queueStrategy = new JPanel(new BorderLayout());
	queueStrategy.add(new JLabel("Station queue policy: "), BorderLayout.WEST);
	queuePolicyCombo = new JComboBox();
	queueStrategy.add(queuePolicyCombo, BorderLayout.CENTER);
	queuePolicyPanel.add(queueStrategy, BorderLayout.NORTH);
	queueStrategy.setBorder(BorderFactory.createEmptyBorder(2, 5, 10, 5));

	queueLengthPanel.add(infiniteQueueSelector);
	queueLengthPanel.add(finiteQueueSelector);
	JPanel spinnerPanel = new JPanel();
	JLabel label = new JLabel("<html>Max no. customers <br>(queue+service)</html>");
	label.setToolTipText("The maximum number of customers allowed in the station.");
	spinnerPanel.add(label);
	spinnerPanel.add(queueLengthSpinner);
	queueLengthPanel.add(spinnerPanel);

	this.add(queueLengthPanel, BorderLayout.WEST);
	this.add(queuePolicyPanel, BorderLayout.CENTER);
}
 
Example 33
Project: jmt   File: BlockingRegionGroupPanel.java   Source Code and License 5 votes vote down vote up
protected void initComponents() {
	setLayout(new BorderLayout(10, 10));
	dialogPanel = new JPanel(new SpringLayout());
	dialogPanel.setBorder(BorderFactory.createTitledBorder(new EtchedBorder(), "Select Member Classes"));
	dialogPanel.setLayout(new BorderLayout(1, 1));
	table = new GroupEditTable();
	dialogPanel.add(new WarningScrollTable(table, WARNING_CLASS));
	add(dialogPanel, BorderLayout.CENTER);
}
 
Example 34
Project: jmt   File: ServiceSectionPanel.java   Source Code and License 5 votes vote down vote up
private void initComponents() {
	//building mainPanel
	this.setLayout(new BorderLayout(5, 5));
	this.setBorder(new EmptyBorder(5, 5, 5, 5));
	//layout of main panel
	JPanel serversNumPanel = new JPanel();
	serversNumPanel.setBorder(new TitledBorder(new EtchedBorder(), "Number of Servers"));
	serversNumPanel.add(new JLabel("Number:"));
	serversNumPanel.add(serversNumSpinner);
	this.add(serversNumPanel, BorderLayout.NORTH);
	WarningScrollTable ServiceSectionTable = new WarningScrollTable(serviceTable, WARNING_CLASS);
	ServiceSectionTable.setBorder(new TitledBorder(new EtchedBorder(), "Service Time Distributions"));
	this.add(ServiceSectionTable, BorderLayout.CENTER);
}
 
Example 35
Project: jmt   File: TimingSectionPanel.java   Source Code and License 5 votes vote down vote up
private void initComponents() {
	setLayout(new BorderLayout(3, 3));
	setBorder(new EmptyBorder(5, 5, 5, 5));

	addModeButton = new JButton("Add Mode");
	addModeButton.setMinimumSize(DIM_BUTTON_M);

	OptionTable = new TimingOptionTable();
	JScrollPane OptionPane = new JScrollPane(OptionTable);
	OptionPane.setBorder(new TitledBorder(new EtchedBorder(), "Timing Options"));

	add(addModeButton, BorderLayout.NORTH);
	add(OptionPane, BorderLayout.CENTER);
}
 
Example 36
Project: jmt   File: SeedPanel.java   Source Code and License 5 votes vote down vote up
public void initialize() {
	JPanel edit = new JPanel(new GridLayout(4, 1, 0, 5));
	stepsLabel = new JLabel("Steps:");
	steps = new JSpinner(new SpinnerNumberModel(SPA.getNumberOfSteps(), 2, ParametricAnalysis.MAX_STEP_NUMBER, 1));
	steps.setToolTipText("Sets the number of performed simulations");
	edit.add(stepsLabel);
	edit.add(steps);
	edit.setPreferredSize(new Dimension(130, 108));
	JPanel editLables = new JPanel(new GridLayout(4, 1, 0, 5));
	editLables.add(stepsLabel);
	editLables.setPreferredSize(new Dimension(100, 108));
	JPanel editPanel = new JPanel();
	editPanel.add(editLables);
	editPanel.add(edit);
	editPanel.setBorder(new EmptyBorder(10, 20, 0, 20));
	JPanel cont = new JPanel(new BorderLayout());
	title = new TitledBorder("Simulation seed variation");
	cont.add(editPanel, BorderLayout.CENTER);
	scroll = new JScrollPane(cont);
	scroll.setBorder(title);
	description = new JTextArea(DESCRIPTION);
	description.setOpaque(false);
	description.setEditable(false);
	description.setLineWrap(true);
	description.setWrapStyleWord(true);
	descrPane = new JScrollPane(description);
	descriptionTitle = new TitledBorder(new EtchedBorder(), "Description");
	descrPane.setBorder(descriptionTitle);
	descrPane.setMinimumSize(new Dimension(80, 0));
	scroll.setMinimumSize(new Dimension(360, 0));
	setLeftComponent(scroll);
	setRightComponent(descrPane);
	setListeners();
	this.setBorder(new EmptyBorder(5, 0, 5, 0));
}
 
Example 37
Project: jmt   File: RoutingProbabilitiesEditor.java   Source Code and License 5 votes vote down vote up
public void setData(StationDefinition sd, ClassDefinition cs, Object stationKey, Object classKey) {
	RoutingStrategy rs = (RoutingStrategy) sd.getRoutingStrategy(stationKey, classKey);
	if (rs == null) {
		descrTextPane.setText("");
		emptyPane();
	} else {
		descrTextPane.setText(rs.getDescription());
		if (rs instanceof ProbabilityRouting) {
			createDetails(rs, sd, cs, stationKey, classKey);
		} else if (rs instanceof LoadDependentRouting) {
			JComponent LDRoutingPanel = new JPanel();
			LDRoutingPanel.setBorder(new TitledBorder(new EtchedBorder(), "LD Routing Options"));
			if (sd.getForwardConnections(stationKey).size() > 0) {
				JButton editLoadDependentRoutingButton = new JButton("Edit LD Routing..");
				HashMap<String, Object> ldParameters = new HashMap<String, Object>();
				ldParameters.put("ClassDefinition", cs);
				ldParameters.put("StationDefinition", sd);
				ldParameters.put("stationKey", stationKey);
				ldParameters.put("classKey", classKey);
				String stationName = sd.getStationName(stationKey);
				String className = cs.getClassName(classKey);
				ldParameters.put("title", "Editing for [Class] " + className + " for [Station] " + stationName + " Load Dependent Routing ...");
				editLoadDependentRoutingButton.addActionListener(new EditLoadDependentRoutingListener(ldParameters));
				LDRoutingPanel.add(editLoadDependentRoutingButton);
			} else {
				LDRoutingPanel = rtPane;
			}
			setRightComponent(LDRoutingPanel);
		} else {
			emptyPane();
		}
	}
	doLayout();
}
 
Example 38
Project: JAddOn   File: JATextInput.java   Source Code and License 5 votes vote down vote up
public JATextInput(Component c, String title, String borderText) {
    setPreferredSize(new Dimension(100, 300));
    panelControl.setLayout(new FlowLayout());
    setLayout(new BorderLayout());
    setLocationRelativeTo(c);
    setTitle(title);
    ta.setBorder(new TitledBorder(new EtchedBorder(), borderText));
    add(sp, BorderLayout.CENTER);
}
 
Example 39
Project: AI-RRT-Motion-Planning   File: Visualiser.java   Source Code and License 5 votes vote down vote up
private void createComponents() {
	vp = new VisualisationPanel(this);
	JPanel wp = new JPanel(new BorderLayout());
	wp.add(vp, BorderLayout.CENTER);
	container.setLayout(new BorderLayout());
	wp.setBorder(BorderFactory.createCompoundBorder(
			BorderFactory.createEmptyBorder(5, 10, 10, 10),
			BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)));
	container.add(wp, BorderLayout.CENTER);

	infoPanel = new JPanel();
	infoPanel.setLayout(new FlowLayout());

	infoLabel = new JLabel("No problem to display.");
	samplingSpinner = new JSpinner(new SpinnerNumberModel(
			SAMPLING_PERIOD_INIT, 1, null, 1));
	samplingSpinner.addChangeListener(samplingListener);
	samplingSpinner.setPreferredSize(new Dimension(50, 20));
	samplingSpinner.setVisible(false);
	vp.setSamplingPeriod(SAMPLING_PERIOD_INIT);
	infoPanel.add(infoLabel);
	infoPanel.add(samplingSpinner);

	container.add(infoPanel, BorderLayout.NORTH);

	createMenus();
	createAnimationControls();
}
 
Example 40
Project: DecompiledMinecraft   File: MinecraftServerGui.java   Source Code and License 5 votes vote down vote up
/**
 * Generates new StatsComponent and returns it.
 */
private JComponent getStatsComponent() throws Exception
{
    JPanel jpanel = new JPanel(new BorderLayout());
    jpanel.add(new StatsComponent(this.server), "North");
    jpanel.add(this.getPlayerListComponent(), "Center");
    jpanel.setBorder(new TitledBorder(new EtchedBorder(), "Stats"));
    return jpanel;
}