private MainPanel() { super(new GridLayout(3, 1, 5, 5)); final JTree tree = new JTree(); final JCheckBox c = new JCheckBox("CheckBox", true); c.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { tree.setEnabled(c.isSelected()); } }); c.setFocusPainted(false); JScrollPane l1 = new JScrollPane(tree); l1.setBorder(new ComponentTitledBorder(c, l1, BorderFactory.createEtchedBorder())); JLabel icon = new JLabel(new ImageIcon(getClass().getResource("16x16.png"))); JLabel l2 = new JLabel("<html>aaaaaaaaaaaaaaaa<br>bbbbbbbbbbbbbbbbb"); l2.setBorder(new ComponentTitledBorder(icon, l2, BorderFactory.createEtchedBorder())); JButton b = new JButton("Button"); b.setFocusPainted(false); JLabel l3 = new JLabel("ccccccccccccccc"); l3.setBorder(new ComponentTitledBorder(b, l3, BorderFactory.createEtchedBorder())); add(l1); add(l2); add(l3); setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); setPreferredSize(new Dimension(320, 240)); }
private void buildFields() { JLabel lbFaculty = new JLabel("Факультет:"); lbFaculty.setHorizontalAlignment(SwingConstants.RIGHT); lbFaculty.setBounds(new Rectangle(PAD, 0 * H_B + PAD, W_L, H_B)); add(lbFaculty); txtFaculty.setBounds(new Rectangle(W_L + 2 * PAD, 0 * H_B + PAD, W_T, H_B)); txtFaculty.setBorder(BorderFactory.createEtchedBorder()); add(txtFaculty); JLabel lbNOG = new JLabel("Группа:"); lbNOG.setHorizontalAlignment(SwingConstants.RIGHT); lbNOG.setBounds(new Rectangle(PAD, 1 * H_B + PAD, W_L, H_B)); add(lbNOG); txtNOG.setBounds(new Rectangle(W_L + 2 * PAD, 1 * H_B + PAD, W_T, H_B)); txtNOG.setBorder(BorderFactory.createEtchedBorder()); add(txtNOG); JLabel lbName = new JLabel("Имя:"); lbName.setHorizontalAlignment(SwingConstants.RIGHT); lbName.setBounds(new Rectangle(PAD, 2 * H_B + PAD, W_L, H_B)); add(lbName); txtName.setBounds(new Rectangle(W_L + 2 * PAD, 2 * H_B + PAD, W_T, H_B)); txtName.setBorder(BorderFactory.createEtchedBorder()); add(txtName); JLabel lbDOE = new JLabel("Дата зачисления:"); lbDOE.setHorizontalAlignment(SwingConstants.RIGHT); lbDOE.setBounds(new Rectangle(PAD, 3 * H_B + PAD, W_L, H_B)); add(lbDOE); txtDOE.setBounds(new Rectangle(W_L + 2 * PAD, 3 * H_B + PAD, W_T, H_B)); txtDOE.setBorder(BorderFactory.createEtchedBorder()); add(txtDOE); }
OperPanel() { setLayout(null); add(tabPanel); Border border_1 = BorderFactory.createEtchedBorder(1); tabPanel.setBorder(border_1); tabPanel.setBounds(5, 5, 630, 630); tabPanel.setLayout(new BorderLayout()); add(modiPanel); Border border_2 = BorderFactory.createEtchedBorder(1); modiPanel.setBorder(border_2); modiPanel.setBounds(640, 5, 310, 630); modiPanel.setLayout(null); }
private JPanel getPredefinedSettingsPanel() { if (predefinedSettingsPanel == null) { predefinedSettingsPanel = new JPanel(); predefinedSettingsPanel.setBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "Predefined settings")); predefinedSettingsPanel.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(5, 5, 5, 5); c.anchor = GridBagConstraints.PAGE_START; c.gridx = 0; c.gridy = 0; c.gridwidth = 3; predefinedSettingsPanel.add(new JLabel("Set all rendering settings towards:"), c); c.weightx = 1f / 3; c.gridwidth = 1; c.gridy = 2; predefinedSettingsPanel.add(getPredefinedPlatformDefaultButton(), c); c.gridx = 1; predefinedSettingsPanel.add(getPredefinedSpeedButton(), c); c.gridx = 2; predefinedSettingsPanel.add(getPredefinedQualityButton(), c); } return predefinedSettingsPanel; }
// Initializes this component. private void jbInit() { segmentTable.addFocusListener( new FocusListener() { public void focusGained(FocusEvent e) { segmentTable_focusGained(e); } public void focusLost(FocusEvent e) { segmentTable_focusLost(e); } }); segmentTable.setTableHeader(null); scrollPane = new JScrollPane(segmentTable); scrollPane.setMinimumSize(new Dimension(getTableWidth(), 0)); setLayout(new BorderLayout(0, 0)); determineColumnWidth(); nameLbl.setPreferredSize(new Dimension(getTableWidth(), 25)); nameLbl.setMinimumSize(new Dimension(getTableWidth(), 0)); nameLbl.setFont(Utilities.labelsFont); segmentTable.setFont(Utilities.valueFont); setBorder(BorderFactory.createEtchedBorder()); setMinimumSize(new Dimension(getTableWidth(), 0)); this.add(nameLbl, BorderLayout.NORTH); this.add(scrollPane, BorderLayout.CENTER); }
// {{{createCenterPanelAll() method public JPanel createCenterPanelAll() { long filesSize = 0L; JPanel centerPanel = new JPanel(new BorderLayout()); for (VFSFile selectedFile : selectedFiles) { if (selectedFile.getType() == VFSFile.DIRECTORY) { File ioFile = new File(selectedFile.getPath()); filesSize += IOUtilities.fileLength(ioFile); } else if (selectedFile.getType() == VFSFile.FILE) filesSize += selectedFile.getLength(); } JPanel propField = new JPanel(); propField.setLayout(new GridLayout(2, 1)); String path = local.getPath(); if (OperatingSystem.isWindows() || OperatingSystem.isWindows9x() || OperatingSystem.isWindowsNT()) { path = path.substring(0, path.lastIndexOf(92)); // 92 = '\' } else { path = path.substring(0, path.lastIndexOf('/')); } propField.add(new JLabel(jEdit.getProperty("fileprop.path") + ": " + path)); propField.add( new JLabel( jEdit.getProperty("fileprop.size") + ": " + StandardUtilities.formatFileSize(filesSize))); Border etch = BorderFactory.createEtchedBorder(); propField.setBorder( BorderFactory.createTitledBorder(etch, jEdit.getProperty("fileprop.properties"))); centerPanel.add(BorderLayout.CENTER, propField); return centerPanel; } // }}}
/** * Renvoit le JPanel à afficher, avec en paramètre un booléen indiquant s'il s'agit du dernier * élément à afficher dans une liste d'enfants (auquel cas un bouton + peut être affiché) */ private JPanel getPanel(final boolean dernier) { panelEnfants = new JPanel(new GridBagLayout()); panelElement = new JPanel(new BorderLayout()); if (!attribut && affParent != null && affParent.enfantsMultiples(refNoeud)) { final JPanel panelBoutons = new JPanel(new BorderLayout()); if (dernier) { final JButton boutonPlus = new JButton("+"); boutonPlus.setAction( new AbstractAction("+") { public void actionPerformed(final ActionEvent e) { affParent.ajouterAffichageEnfant(AffichageFormulaire.this); } }); panelBoutons.add(boutonPlus, BorderLayout.WEST); } final JButton boutonMoins = new JButton("-"); boutonMoins.setAction( new AbstractAction("-") { public void actionPerformed(final ActionEvent e) { affParent.retirerAffichageEnfant(AffichageFormulaire.this); } }); panelBoutons.add(boutonMoins, BorderLayout.EAST); panelElement.add(panelBoutons, BorderLayout.EAST); panelElement.add(panelEnfants, BorderLayout.CENTER); } else panelElement.add(panelEnfants, BorderLayout.CENTER); if (affParent != null) { panelElement.add(getPanelTitre(), BorderLayout.NORTH); panelEnfants.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder(5, 5, 5, 5))); panelElement.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); } majPanel(null); if (affParent == null) { panelEnfants.setFocusCycleRoot(true); panelElement = new JPanel(new BorderLayout()) { @Override public Dimension getMaximumSize() { if (System.getProperty("os.name") .startsWith("Mac OS")) { // curseur pas visible à droite sur la JVM d'Apple avec // getMaximumSize() final Dimension tps = doc.textPane.getSize(); final JaxeElement je = doc.getElementForNode(noeud); return (new Dimension(tps.width - 20 * (je.indentations() + 1) - 2, tps.height)); } return (super.getMaximumSize()); } }; panelElement.setOpaque(false); panelElement.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); panelEnfants.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder(getTitre()), BorderFactory.createEmptyBorder(5, 5, 5, 5))); panelElement.add(panelEnfants, BorderLayout.CENTER); } return (panelElement); }
/** 查询 */ private void search() { // 调用查询窗口 Function function = new Function(); Search search = new Search(this, staffInfo); function.setFunctionDialog(search); function.create(); if (search.isUpdate()) { int searched = search.getSearched(); switch (searched) { case 0: DMManage(); break; case 1: break; case 3: break; case 4: break; case 5: break; } content = search.getResultContent(); header = search.getResultHeader(); displayPanel.setBorder( BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "查询结果")); setTable(content, header); } }
private void initComponents(String title) { getContentPane().setLayout(new BorderLayout()); JPanel mainPane = new JPanel(new BorderLayout()); mainPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); JLabel text = new JLabel(title, JLabel.CENTER); text.setFont(FONT); text.setOpaque(true); text.setBackground(Color.orange); // text.setFont(UIManager.getFont("Label.font")); mainPane.add(text, "North"); JPanel panel = new JPanel(new GridLayout(1, 6)); for (int i = 1; i <= 6; i++) { Die die = template.getCopy(); die.setFace(i); FaceButton button = new FaceButton(die, i); panel.add(button); } mainPane.add(panel, "South"); if (icon != null) { JLabel iconLabel = new JLabel(icon); iconLabel.setBorder(BorderFactory.createEtchedBorder()); mainPane.add(iconLabel, "Center"); } getContentPane().add(mainPane, "Center"); setResizable(false); setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); pack(); }
private JPanel createCentrePanel(YDataStateException exception) { JPanel centrePanel = new JPanel(new GridLayout(1, 2)); JPanel msgPanel = new JPanel(new BorderLayout()); msgPanel.setBackground(YAdminGUI._apiColour); msgPanel.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "Schema for completing task"), BorderFactory.createEmptyBorder(10, 10, 10, 10))); JTextPane msgTextPane = new JTextPane(); msgTextPane.setContentType("text/plain"); msgTextPane.setFont(new Font("courier", Font.PLAIN, 12)); msgTextPane.setForeground(Color.RED); msgTextPane.setText(exception.getMessage()); msgTextPane.setEditable(false); msgTextPane.setBackground(Color.LIGHT_GRAY); JPanel noWrapPanel = new JPanel(); noWrapPanel.setLayout(new BorderLayout()); noWrapPanel.add(msgTextPane); msgPanel.add(new JScrollPane(noWrapPanel)); centrePanel.add(msgPanel, BorderLayout.NORTH); return centrePanel; }
private JPanel createRadioButtonPanel() { JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new GridLayout(1, 3)); middleButton = new JRadioButton("Middle Page"); middleButton.setHorizontalAlignment(AbstractButton.CENTER); middleButton.setActionCommand(Page.MIDDLE); middleButton.setEnabled(false); endButton = new JRadioButton("End Page"); endButton.setHorizontalAlignment(AbstractButton.CENTER); endButton.setActionCommand(Page.END); endButton.setEnabled(false); initButton = new JRadioButton("Start Page"); initButton.setHorizontalAlignment(AbstractButton.CENTER); initButton.setActionCommand(Page.START); initButton.setEnabled(false); ButtonGroup group = new ButtonGroup(); group.add(initButton); group.add(middleButton); group.add(endButton); buttonPanel.add(initButton); buttonPanel.add(middleButton); buttonPanel.add(endButton); buttonPanel.setBorder(BorderFactory.createEtchedBorder()); return buttonPanel; }
public PropertyPanel(String title, Properties properties) { super(); setBorder(new TitledBorder(BorderFactory.createEtchedBorder(), title)); setLayout(new GridLayout(1, 1, 10, 10)); JTextArea area = new JTextArea(Math.min(properties.size(), 20), 40); area.setEditable(false); area.setOpaque(false); area.setTabSize(16); Iterator iter = properties.keySet().iterator(); if (iter.hasNext()) { // first line String key = (String) iter.next(); area.append(key); area.append("\t"); area.append(properties.getProperty(key)); } while (iter.hasNext()) { // remaining lines area.append("\n"); String key = (String) iter.next(); area.append(key); area.append("\t"); area.append(properties.getProperty(key)); } add(new JScrollPane(area)); }
/** Constructs a new Sceen with given height & width (in words) and amount of bits per word. */ public ScreenComponent() { setOpaque(true); setBackground(Color.white); setBorder(BorderFactory.createEtchedBorder()); Insets borderInsets = getBorder().getBorderInsets(this); int borderWidth = borderInsets.left + borderInsets.right; int borderHeight = borderInsets.top + borderInsets.bottom; setPreferredSize( new Dimension( Definitions.SCREEN_WIDTH + borderWidth, Definitions.SCREEN_HEIGHT + borderHeight)); setSize(Definitions.SCREEN_WIDTH + borderWidth, Definitions.SCREEN_HEIGHT + borderHeight); data = new short[Definitions.SCREEN_SIZE]; x = new int[Definitions.SCREEN_SIZE]; y = new int[Definitions.SCREEN_SIZE]; x[0] = borderInsets.left; y[0] = borderInsets.top; // updates pixels indice for (int i = 1; i < Definitions.SCREEN_SIZE; i++) { x[i] = x[i - 1] + Definitions.BITS_PER_WORD; y[i] = y[i - 1]; if (x[i] == Definitions.SCREEN_WIDTH + borderInsets.left) { x[i] = borderInsets.left; y[i]++; } } timer = new Timer(STATIC_CLOCK_INTERVALS, this); timer.start(); }
/** Panel avec le titre de l'élément, et les boutons d'aide et d'attributs de l'élément */ private JPanel getPanelTitre() { final JButton baide = new JButton(new ActionAide(refNoeud)); baide.setFont(baide.getFont().deriveFont((float) 9)); if (System.getProperty("os.name").startsWith("Mac OS")) { baide.setText("?"); if ("10.5".compareTo(System.getProperty("os.version")) <= 0) baide.putClientProperty("JButton.buttonType", "help"); else baide.putClientProperty("JButton.buttonType", "toolbar"); } else { baide.setIcon(new ImageIcon(ImageKeeper.loadImage("images/aide.png"))); baide.setMargin(new Insets(0, 0, 0, 0)); baide.setBorderPainted(false); baide.setContentAreaFilled(false); } String documentation = getDocumentation(); if (documentation != null) baide.setToolTipText(documentation); final JPanel panelTitre = new JPanel(); panelTitre.add(baide); final JLabel labelTitre = new JLabel(getTitre()); Color couleurTitre; if (affParent != null) { if (obligatoire()) couleurTitre = couleurObligatoire; else couleurTitre = couleurFacultatif; } else couleurTitre = panelEnfants.getForeground(); labelTitre.setForeground(couleurTitre); panelTitre.add(labelTitre); panelTitre.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED)); final JPanel panelNord = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0)); panelNord.add(panelTitre); return (panelNord); }
public OKPanel() { setLayout(new FlowLayout(FlowLayout.RIGHT)); setBorder(BorderFactory.createEtchedBorder()); JButton saveButton = new JButton(StringConstants.BUTTON_SAVE); saveButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { saveSettings(); thisFrame.setVisible(false); } }); JButton cancelButton = new JButton(StringConstants.BUTTON_CANCEL); cancelButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent event) { thisFrame.setVisible(false); // System.exit(0); } }); add(saveButton); add(cancelButton); }
/** * This method wraps all the shared logic of the various constructors. * * @param aXAxisData double[] with all the X axis data. * @param aYAxisData double[] with all the Y axis data. * @param aXAxisLabel String with the label for the x-axis (can have a unit between brackets, if * available) - can be 'null' for no label * @param aYAxisLabel String with the label for the y-axis (can have a unit between brackets, if * available) - can be 'null' for no label */ private void initData( double[] aXAxisData, double[] aYAxisData, String aXAxisLabel, String aYAxisLabel) { this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); this.setBackground(Color.WHITE); processXAndYData(aXAxisData, aYAxisData, iChromatogramColor, iChromatogramPointColor); this.iXAxisLabel = (aXAxisLabel == null ? "unknown" : aXAxisLabel); this.iYAxisLabel = (aYAxisLabel == null ? "unknown" : aYAxisLabel); }
/* *Creates the JTextField for the GUI. */ private JTextField inputField() { inputField = new JTextField(); Border inputBorder = BorderFactory.createEtchedBorder(); inputBorder = BorderFactory.createTitledBorder(inputBorder, "Please type your words here:"); inputField.setBorder(inputBorder); inputField.addActionListener(new ActionListenerField()); return inputField; }
@Override protected JComponent createCenterPanel() { final JPanel panel = new JPanel(new BorderLayout()); JTextArea area = new JTextArea( "The imported language extends other languages.\n" + "It might be useful to import all or some of them."); area.setEditable(false); area.setBackground(this.getContentPane().getBackground()); area.setBorder(BorderFactory.createEmptyBorder(5, 5, 3, 5)); panel.add(area, BorderLayout.NORTH); JPanel center = new JPanel(new GridBagLayout()); JTextArea label = new JTextArea("Select additional languages to import:"); label.setEditable(false); label.setBackground(getContentPane().getBackground()); label.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); center.add( label, new GridBagConstraints( 0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); myList = new JBList(myCandidates.toArray()); myList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); myList.setSelectionInterval(0, myList.getModel().getSize() - 1); myList.setCellRenderer(new MyDefaultListCellRenderer()); myList.setBorder(BorderFactory.createEtchedBorder()); center.add( ScrollPaneFactory.createScrollPane(myList), new GridBagConstraints( 0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel.add(center, BorderLayout.CENTER); panel.setPreferredSize(new Dimension(400, 250)); return panel; }
protected void setMainComponent() { mainComponent = new JPanel(new GridBagLayout()); currentPanel = (JPanel) mainComponent; Border mainComponentBorder = BorderFactory.createCompoundBorder( BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder(5 + inset, 5 + inset, 5 + inset, 5 + inset)); currentPanel.setBorder(mainComponentBorder); }
public static ChartPanel createBubbleChart() { JFreeChart jfreechart = createChart(createXYZDataset()); ChartPanel chartpanel = new ChartPanel(jfreechart); chartpanel.setBorder(BorderFactory.createEtchedBorder()); chartpanel.setDomainZoomable(true); chartpanel.setRangeZoomable(true); return chartpanel; }
public void setBorder(JPanel panel, String theme) { panel.setBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), theme, javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION, new Font("Tahoma", Font.PLAIN, 11), Color.blue.darker().darker())); }
@Override public void updateUI() { super.updateUI(); // putClientProperty(SwingUtilities2.AA_TEXT_PROPERTY_KEY, null); if (UIUtil.isMotifLookAndFeel()) { setBorder(BorderFactory.createEtchedBorder()); } else if (!UIUtil.isUnderGTKLookAndFeel()) { setBorder(UIUtil.getButtonBorder()); } }
private JPanel getOtherSettingsPanel() { if (otherSettingsPanel == null) { otherSettingsPanel = new JPanel(); otherSettingsPanel.setBorder( BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Other settings")); otherSettingsPanel.setLayout(new BoxLayout(otherSettingsPanel, BoxLayout.Y_AXIS)); otherSettingsPanel.add(getOptionsRenderingBufferImagesCheckBox()); otherSettingsPanel.add(getOptionsRenderingForceBulletColorCheckBox()); } return otherSettingsPanel; }
public MavenProjectImportStep(WizardContext wizardContext) { super(wizardContext); myImportingSettingsForm = new MavenImportingSettingsForm(true, wizardContext.isCreatingNewProject()) { public String getDefaultModuleDir() { return myRootPathComponent.getPath(); } }; myRootPathComponent = new NamePathComponent( "", ProjectBundle.message("maven.import.label.select.root"), ProjectBundle.message("maven.import.title.select.root"), "", false, false); JButton envSettingsButton = new JButton(ProjectBundle.message("maven.import.environment.settings")); envSettingsButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { ShowSettingsUtil.getInstance() .editConfigurable(myPanel, new MavenEnvironmentConfigurable()); } }); myPanel = new JPanel(new GridBagLayout()); myPanel.setBorder(BorderFactory.createEtchedBorder()); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.weightx = 1; c.fill = GridBagConstraints.HORIZONTAL; c.insets = JBUI.insets(4, 4, 0, 4); myPanel.add(myRootPathComponent, c); c.gridy = 1; c.insets = JBUI.insets(4, 4, 0, 4); myPanel.add(myImportingSettingsForm.createComponent(), c); c.gridy = 2; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.NORTHEAST; c.weighty = 1; c.insets = JBUI.insets(4 + envSettingsButton.getPreferredSize().height, 4, 4, 4); myPanel.add(envSettingsButton, c); myRootPathComponent.setNameComponentVisible(false); }
private JPanel getSelectedRobotsPanel() { if (selectedRobotsPanel == null) { selectedRobotsPanel = new JPanel(); selectedRobotsPanel.setLayout(new BorderLayout()); selectedRobotsPanel.setPreferredSize(new Dimension(120, 100)); selectedRobotsPanel.setBorder( BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Selected Robots")); selectedRobotsPanel.add(getSelectedRobotsScrollPane(), BorderLayout.CENTER); } return selectedRobotsPanel; }
// {{{ createCenterPanel() method public JPanel createCenterPanel() { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm"); JPanel centerPanel = new JPanel(new BorderLayout()); JPanel propField = new JPanel(); propField.setLayout(new GridLayout(4, 1)); propField.add(new JLabel(jEdit.getProperty("fileprop.name") + ": " + local.getName())); propField.add(new JLabel(jEdit.getProperty("fileprop.path") + ": " + local.getPath())); // Show last modified property only for LocalFile if (local instanceof LocalFile) { propField.add( new JLabel( jEdit.getProperty("fileprop.lastmod") + ": " + sdf.format(new Date(((LocalFile) local).getModified())))); } if (local.getType() == VFSFile.DIRECTORY) { File ioFile = new File(local.getPath()); propField.add( new JLabel( jEdit.getProperty("fileprop.size") + ": " + StandardUtilities.formatFileSize(IOUtilities.fileLength(ioFile)))); } else { propField.add( new JLabel( jEdit.getProperty("fileprop.size") + ": " + StandardUtilities.formatFileSize(local.getLength()))); } Border etch = BorderFactory.createEtchedBorder(); propField.setBorder( BorderFactory.createTitledBorder(etch, jEdit.getProperty("fileprop.properties"))); centerPanel.add(BorderLayout.CENTER, propField); JPanel attributeField = new JPanel(); attributeField.setLayout(new GridLayout(1, 2)); readable = new JCheckBox(jEdit.getProperty("fileprop.readable")); readable.setSelected(local.isReadable()); readable.setEnabled(false); attributeField.add(readable); write = new JCheckBox(jEdit.getProperty("fileprop.writeable")); write.setSelected(local.isWriteable()); write.setEnabled(false); attributeField.add(write); attributeField.setBorder( BorderFactory.createTitledBorder(etch, jEdit.getProperty("fileprop.attribute"))); centerPanel.add(BorderLayout.SOUTH, attributeField); return centerPanel; } // }}}
@SuppressWarnings({"AbstractMethodCallInConstructor", "ThisEscapedInObjectConstruction"}) protected AbstractGameDisplay() { doAddWindowListener(this); addMenuBar(); // A pane for the entire center area: map, status. JPanel contentPane = new JPanel(new BorderLayout()); doAddKeyListener(contentPane); setContentPane(contentPane); contentPane.setBorder(BorderFactory.createEtchedBorder()); // ..add the map. JPanel westContainer = new JPanel(new BorderLayout()); _mapPane = createMapPane(); _mapPane.addMouseListener(this); JScrollPane mapContainer = new JScrollPane(_mapPane); mapContainer.setBorder(BorderFactory.createEtchedBorder()); // ..add the status area. JPanel statusPaneContainer = new JPanel(new BorderLayout()); // hack to deal with text area sizing bug. statusPaneContainer.setAlignmentX(Component.LEFT_ALIGNMENT); _statusPane = createStatusPane(); _statusPane.setEditable(false); statusPaneContainer.add(_statusPane, BorderLayout.WEST); westContainer.add(mapContainer, BorderLayout.CENTER); westContainer.add(statusPaneContainer, BorderLayout.SOUTH); // The side pane with all the currently relevant details (e.g. selected hex info). _detailsPane = createDetailsPane(); _detailsPane.setBorder(BorderFactory.createEtchedBorder()); // A bottom pane with a list of the game events from the previously run turn. _eventsPane = createEventsPane(); _eventsPane.setBorder(BorderFactory.createEtchedBorder()); contentPane.add(westContainer, BorderLayout.CENTER); contentPane.add(_detailsPane, BorderLayout.EAST); contentPane.add(_eventsPane, BorderLayout.SOUTH); }
private JPanel getSpecificSettingsPanel() { if (specificSettingsPanel == null) { specificSettingsPanel = new JPanel(); specificSettingsPanel.setBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "Specific settings")); specificSettingsPanel.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(5, 5, 5, 5); c.anchor = GridBagConstraints.PAGE_START; c.weightx = 0; c.gridwidth = 2; c.gridx = 0; c.gridy = 0; specificSettingsPanel.add(new JLabel("Set individual rendering options:"), c); c.gridwidth = 1; c.gridy = 1; specificSettingsPanel.add(new JLabel("Antialiasing", SwingConstants.RIGHT), c); c.gridx = 1; specificSettingsPanel.add(getOptionsRenderingAntialiasingComboBox(), c); c.gridx = 0; c.gridy = 2; specificSettingsPanel.add(new JLabel("Text Antialiasing", SwingConstants.RIGHT), c); c.gridx = 1; specificSettingsPanel.add(getOptionsRenderingTextAntialiasingComboBox(), c); c.gridx = 0; c.gridy = 3; specificSettingsPanel.add(new JLabel("Rendering Method", SwingConstants.RIGHT), c); c.gridx = 1; specificSettingsPanel.add(getOptionsRenderingMethodComboBox(), c); c.gridx = 0; c.gridy = 4; specificSettingsPanel.add(new JLabel(" "), c); c.gridx = 0; c.gridy = 5; specificSettingsPanel.add(new JLabel("Number of buffers", SwingConstants.RIGHT), c); c.gridx = 1; specificSettingsPanel.add(getOptionsRenderingNoBuffersComboBox(), c); } return specificSettingsPanel; }
public StatusBar() { setLayout(new FlowLayout(0)); setBorder(BorderFactory.createEtchedBorder()); progressBar = new JProgressBar(0, 0, 100); progressBar.setPreferredSize(new Dimension(60, progressBar.getPreferredSize().height + 2)); progressBar.setVisible(false); label = new JLabel( " "); preferredSize = new Dimension(getWidth(label.getText()), 2 * getFontHeight()); add(progressBar); add(label); }
public TabButton() { int size = 17; setPreferredSize(new Dimension(size, size)); setToolTipText("Fermer cet onglet"); setUI(new BasicButtonUI()); setContentAreaFilled(false); setFocusable(false); setBorder(BorderFactory.createEtchedBorder()); setBorderPainted(false); addMouseListener(buttonMouseListener); setRolloverEnabled(true); addActionListener(this); }