Search in sources :

Example 41 with BevelBorder

use of javax.swing.border.BevelBorder in project JRomManager by optyfr.

the class ScannerDirPanel method buildSrcDirs.

/**
 * @param session
 */
private void buildSrcDirs(final Session session) {
    // $NON-NLS-1$
    JLabel lblSrcDir = new JLabel(Messages.getString("MainFrame.lblSrcDir.text"));
    lblSrcDir.setHorizontalAlignment(SwingConstants.TRAILING);
    final GridBagConstraints gbcLblSrcDir = new GridBagConstraints();
    gbcLblSrcDir.fill = GridBagConstraints.HORIZONTAL;
    gbcLblSrcDir.anchor = GridBagConstraints.NORTH;
    gbcLblSrcDir.insets = new Insets(0, 0, 0, 5);
    gbcLblSrcDir.gridx = 0;
    gbcLblSrcDir.gridy = 6;
    this.add(lblSrcDir, gbcLblSrcDir);
    // $NON-NLS-1$ //$NON-NLS-1$ //$NON-NLS-2$ // $NON-NLS-2$
    listSrcDir = new JFileDropList(files -> session.getCurrProfile().setProperty(ProfileSettingsEnum.src_dir, String.join("|", files.stream().map(File::getAbsolutePath).collect(Collectors.toList()))));
    listSrcDir.setMode(JFileDropMode.DIRECTORY);
    // $NON-NLS-1$
    listSrcDir.setUI(new JListHintUI(Messages.getString(MAIN_FRAME_DROP_DIR_HINT), Color.gray));
    final GridBagConstraints gbcListSrcDir = new GridBagConstraints();
    gbcListSrcDir.insets = new Insets(0, 0, 5, 5);
    gbcListSrcDir.gridwidth = 2;
    gbcListSrcDir.fill = GridBagConstraints.BOTH;
    gbcListSrcDir.gridx = 1;
    gbcListSrcDir.gridy = 6;
    this.add(listSrcDir, gbcListSrcDir);
    listSrcDir.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
}
Also used : Color(java.awt.Color) Insets(java.awt.Insets) JRMFileChooser(jrm.ui.basic.JRMFileChooser) SwingConstants(javax.swing.SwingConstants) StringUtils(org.apache.commons.lang3.StringUtils) SwingUtilities(javax.swing.SwingUtilities) ProfileSettingsEnum(jrm.misc.ProfileSettingsEnum) JMenuItem(javax.swing.JMenuItem) HeadlessException(java.awt.HeadlessException) JFileChooser(javax.swing.JFileChooser) ItemEvent(java.awt.event.ItemEvent) JFileDropList(jrm.ui.basic.JFileDropList) JFileDropTextField(jrm.ui.basic.JFileDropTextField) JListHintUI(jrm.ui.basic.JListHintUI) JButton(javax.swing.JButton) Popup(jrm.ui.basic.Popup) Messages(jrm.locale.Messages) JFileDropMode(jrm.ui.basic.JFileDropMode) JTextFieldHintUI(jrm.ui.basic.JTextFieldHintUI) JPopupMenu(javax.swing.JPopupMenu) BevelBorder(javax.swing.border.BevelBorder) PopupMenuListener(javax.swing.event.PopupMenuListener) GridBagConstraints(java.awt.GridBagConstraints) Collectors(java.util.stream.Collectors) File(java.io.File) PopupMenuEvent(javax.swing.event.PopupMenuEvent) JLabel(javax.swing.JLabel) JCheckBox(javax.swing.JCheckBox) Session(jrm.security.Session) GridBagLayout(java.awt.GridBagLayout) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) BevelBorder(javax.swing.border.BevelBorder) JLabel(javax.swing.JLabel) JFileDropList(jrm.ui.basic.JFileDropList) JListHintUI(jrm.ui.basic.JListHintUI)

Example 42 with BevelBorder

use of javax.swing.border.BevelBorder in project bboss by bbossgroups.

the class Thumbelina method initComponents.

/**
 * Initialize the GUI.
 */
private void initComponents() {
    mPowerBar = new JPanel();
    mUrlText = new JTextField();
    mRunToggle = new JCheckBox();
    mSpeedSlider = new JSlider();
    mReadyProgress = new JProgressBar();
    mQueueProgress = new JProgressBar();
    mBackgroundToggle = new JCheckBox();
    mMainArea = new JSplitPane();
    mPicturePanelScroller = new JScrollPane();
    mHistoryScroller = new JScrollPane();
    mHistory = new JList();
    mQueueSize = new JLabel();
    mVisitedSize = new JLabel();
    mPowerBar.setLayout(new BoxLayout(mPowerBar, BoxLayout.X_AXIS));
    mPowerBar.setBorder(new BevelBorder(BevelBorder.LOWERED));
    mPowerBar.add(mUrlText);
    mRunToggle.setSelected(true);
    mRunToggle.setText("On/Off");
    mRunToggle.setToolTipText("Starts/stops the image presentation.");
    mPowerBar.add(mRunToggle);
    mSpeedSlider.setMajorTickSpacing(1000);
    mSpeedSlider.setMaximum(5000);
    mSpeedSlider.setPaintTicks(true);
    mSpeedSlider.setToolTipText("Set inter-image delay.");
    mSpeedSlider.setValue(500);
    mSpeedSlider.setInverted(true);
    mPowerBar.add(mSpeedSlider);
    mReadyProgress.setToolTipText("Pending images..");
    mReadyProgress.setStringPainted(true);
    mPowerBar.add(mReadyProgress);
    mQueueProgress.setToolTipText("Outstanding image fetches..");
    mQueueProgress.setStringPainted(true);
    mPowerBar.add(mQueueProgress);
    mBackgroundToggle.setSelected(true);
    mBackgroundToggle.setText("On/Off");
    mBackgroundToggle.setToolTipText("Starts/stops background fetching.");
    mPowerBar.add(mBackgroundToggle);
    mVisitedSize.setBorder(new BevelBorder(BevelBorder.LOWERED));
    mVisitedSize.setText("00000");
    mVisitedSize.setToolTipText("Number of URLs examined.");
    mPowerBar.add(mVisitedSize);
    mQueueSize.setBorder(new BevelBorder(BevelBorder.LOWERED));
    mQueueSize.setText("00000");
    mQueueSize.setToolTipText("Number of URLs in queue.");
    mPowerBar.add(mQueueSize);
    mHistory.setModel(new DefaultListModel());
    mHistory.setToolTipText("History");
    mHistory.setDoubleBuffered(false);
    mHistory.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    mHistoryScroller.setViewportView(mHistory);
    mHistoryScroller.setDoubleBuffered(false);
    mPicturePanelScroller.setViewportView(mPicturePanel);
    mPicturePanelScroller.setDoubleBuffered(false);
    mPicturePanelScroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    mPicturePanelScroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    add(mMainArea, java.awt.BorderLayout.CENTER);
    mMainArea.setLeftComponent(mHistoryScroller);
    mMainArea.setRightComponent(mPicturePanelScroller);
    add(mPowerBar, java.awt.BorderLayout.SOUTH);
}
Also used : JCheckBox(javax.swing.JCheckBox) JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) BevelBorder(javax.swing.border.BevelBorder) BoxLayout(javax.swing.BoxLayout) JProgressBar(javax.swing.JProgressBar) JSlider(javax.swing.JSlider) JLabel(javax.swing.JLabel) DefaultListModel(javax.swing.DefaultListModel) JTextField(javax.swing.JTextField) JSplitPane(javax.swing.JSplitPane) JList(javax.swing.JList)

Example 43 with BevelBorder

use of javax.swing.border.BevelBorder in project ambit-mirror by ideaconsult.

the class CoreApp method createStatusBar.

protected JPanel createStatusBar() {
    JPanel sb = new JPanel();
    sb.setPreferredSize(new Dimension(w, 18));
    sb.setLayout(new BorderLayout());
    sb.add(new JLabel(""), BorderLayout.CENTER);
    sb.setBorder(new BevelBorder(BevelBorder.LOWERED));
    return sb;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) BevelBorder(javax.swing.border.BevelBorder) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension)

Example 44 with BevelBorder

use of javax.swing.border.BevelBorder in project PICO by jugnicaragua.

the class VentanaPrincipal method initialize.

/**
 * Initialize the contents of the frame.
 */
private void initialize() {
    setTitle("PICO :: Sistema Contable");
    setName("vPrincipal");
    setBounds(100, 100, 626, 375);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setExtendedState(MAXIMIZED_BOTH);
    JToolBar toolBar_1 = new JToolBar();
    getContentPane().add(toolBar_1, BorderLayout.SOUTH);
    JLabel lblFecha = new JLabel("Fecha: ");
    lblFecha.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
    toolBar_1.add(lblFecha);
    JLabel lblPeriodoFiscal = new JLabel("Periodo Fiscal");
    toolBar_1.add(lblPeriodoFiscal);
    JLabel lblNewLabel = new JLabel("New label");
    toolBar_1.add(lblNewLabel);
    JProgressBar progressBar = new JProgressBar();
    toolBar_1.add(progressBar);
    JToolBar toolBar = new JToolBar();
    getContentPane().add(toolBar, BorderLayout.NORTH);
    JButton btnNewButton = new JButton("Nuevo CD");
    btnNewButton.setIcon(new ImageIcon(VentanaPrincipal.class.getResource("/org/tango-project/tango-icon-theme/16x16/actions/document-new.png")));
    toolBar.add(btnNewButton);
    desktopPane = new JDesktopPane();
    getContentPane().add(desktopPane, BorderLayout.CENTER);
    // Agregando el menu principal a la ventana
    setJMenuBar(new MenuPrincipal());
}
Also used : BevelBorder(javax.swing.border.BevelBorder)

Example 45 with BevelBorder

use of javax.swing.border.BevelBorder in project mars-sim by mars-sim.

the class NavigationTabPanel method buildUI.

@Override
protected void buildUI(JPanel content) {
    // Prepare graphic display panel
    WebPanel graphicDisplayPanel = new WebPanel(new FlowLayout(FlowLayout.CENTER));
    graphicDisplayPanel.setBorder(new EmptyBorder(15, 15, 15, 15));
    content.add(graphicDisplayPanel, BorderLayout.NORTH);
    // Prepare direction display panel
    WebPanel directionDisplayPanel = new WebPanel(new FlowLayout(FlowLayout.CENTER, 1, 1));
    directionDisplayPanel.setBorder(new BevelBorder(BevelBorder.LOWERED));
    graphicDisplayPanel.add(directionDisplayPanel);
    // Prepare direction display
    directionDisplay = new DirectionDisplayPanel(vehicle);
    directionDisplay.setToolTipText("Compass for showing the direction of travel");
    directionDisplayPanel.add(directionDisplay);
    // If vehicle is a vehicle, prepare terrain display.
    WebPanel terrainDisplayPanel = new WebPanel(new FlowLayout(FlowLayout.CENTER, 1, 1));
    terrainDisplayPanel.setBorder(new BevelBorder(BevelBorder.LOWERED));
    graphicDisplayPanel.add(terrainDisplayPanel);
    terrainDisplay = new TerrainDisplayPanel(vehicle);
    terrainDisplay.setToolTipText("Terrain indicator for showing elevation changes");
    terrainDisplayPanel.add(terrainDisplay);
    // Prepare the main panel for housing the driving  spring layout.
    WebPanel mainPanel = new WebPanel(new BorderLayout());
    content.add(mainPanel, BorderLayout.CENTER);
    // Prepare the destination panel for housing the center map button, the destination header label, and the coordinates
    WebPanel destinationPanel = new WebPanel(new FlowLayout(FlowLayout.CENTER));
    // Border border = new MarsPanelBorder();
    // Border margin = new EmptyBorder(5,5,5,5);
    // destinationPanel.setBorder(new CompoundBorder(border, margin));
    mainPanel.add(destinationPanel, BorderLayout.NORTH);
    // Prepare destination left panel
    WebPanel leftPanel = new WebPanel(new FlowLayout(FlowLayout.CENTER));
    destinationPanel.add(leftPanel);
    // Prepare destination label panel
    destinationLabelPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    destinationLabelPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    destinationPanel.add(destinationLabelPanel, BorderLayout.NORTH);
    // Prepare center map button
    final ImageIcon centerIcon = new LazyIcon("center").getIcon();
    centerMapButton = new WebButton(StyleId.buttonUndecorated, centerIcon);
    centerMapButton.setMargin(new Insets(1, 1, 1, 1));
    centerMapButton.addActionListener(this);
    centerMapButton.setToolTipText("Locate the vehicle in Navigator Tool");
    leftPanel.add(centerMapButton);
    // Prepare destination label
    WebLabel destinationLabel = new WebLabel("Destination :", WebLabel.RIGHT);
    leftPanel.add(destinationLabel);
    // Prepare destination button
    destinationButton = new WebButton();
    destinationButton.addActionListener(this);
    // Prepare destination text label
    destinationTextLabel = new WebLabel("", WebLabel.LEFT);
    boolean hasDestination = false;
    Mission mission = missionManager.getMissionForVehicle(vehicle);
    if ((mission != null) && (mission instanceof VehicleMission)) {
        VehicleMission vehicleMission = (VehicleMission) mission;
        if (vehicleMission != null && vehicleMission.getTravelStatus().equals(TravelMission.TRAVEL_TO_NAVPOINT)) {
            hasDestination = true;
            destinationLocationCache = vehicleMission.getNextNavpoint().getLocation();
            NavPoint destinationPoint = vehicleMission.getNextNavpoint();
            if (destinationPoint.isSettlementAtNavpoint()) {
                // If destination is settlement, add destination button.
                destinationSettlementCache = destinationPoint.getSettlement();
                destinationButton.setText(destinationSettlementCache.getName());
                destinationLabelPanel.add(destinationButton);
            } else {
                // If destination is coordinates, add destination text label.
                // "A Navpoint";
                destinationTextCache = Conversion.capitalize(destinationPoint.getDescription());
                destinationTextLabel.setText(destinationTextCache);
                destinationLabelPanel.add(destinationTextLabel);
            }
        }
    }
    if (!hasDestination) {
        // If destination is none, add destination text label.
        destinationTextCache = "";
        destinationTextLabel.setText(destinationTextCache);
        destinationLabelPanel.add(destinationTextLabel);
    }
    // Prepare the top panel for housing the driving  spring layout.
    WebPanel locPanel = new WebPanel(new BorderLayout());
    mainPanel.add(locPanel, BorderLayout.CENTER);
    // Prepare the top panel using spring layout.
    WebPanel destinationSpringPanel = new WebPanel(new SpringLayout());
    destinationSpringPanel.setBorder(new EmptyBorder(15, 5, 15, 5));
    locPanel.add(destinationSpringPanel, BorderLayout.NORTH);
    // Prepare destination latitude label.
    String latitudeString = "";
    if (destinationLocationCache != null) {
        latitudeString = destinationLocationCache.getFormattedLatitudeString();
    }
    destinationLatitudeLabel = addTextField(destinationSpringPanel, "Destination Latitude :", latitudeString, null);
    // Prepare destination longitude label.
    String longitudeString = "";
    if (destinationLocationCache != null)
        longitudeString = destinationLocationCache.getFormattedLongitudeString();
    destinationLongitudeLabel = addTextField(destinationSpringPanel, "Destination Longitude :", longitudeString, null);
    // Prepare distance label.
    String distanceText;
    if ((mission != null) && (mission instanceof VehicleMission) && ((VehicleMission) mission).getTravelStatus().equals(TravelMission.TRAVEL_TO_NAVPOINT)) {
        try {
            remainingDistanceCache = ((VehicleMission) mission).getEstimatedTotalRemainingDistance();
        } catch (Exception e) {
            logger.log(Level.SEVERE, "Error getting estimated total remaining distance.");
        }
        distanceText = DECIMAL_PLACES1.format(remainingDistanceCache) + " km";
    } else {
        remainingDistanceCache = 0D;
        distanceText = "";
    }
    remainingDistanceLabel = addTextField(destinationSpringPanel, "Remaining Distance :", distanceText, null);
    // Prepare ETA label.
    if ((mission != null) && (mission instanceof VehicleMission) && (((VehicleMission) mission).getLegETA() != null)) {
        etaCache = ((VehicleMission) mission).getLegETA().toString();
    } else
        etaCache = "";
    etaLabel = addTextField(destinationSpringPanel, "ETA :", etaCache, null);
    // Prepare status label
    statusLabel = addTextField(destinationSpringPanel, "Status :", vehicle.printStatusTypes(), null);
    // Prepare beacon label
    beaconCache = vehicle.isBeaconOn();
    String beaconString;
    if (beaconCache)
        beaconString = "On";
    else
        beaconString = "Off";
    beaconLabel = addTextField(destinationSpringPanel, "Emergency Beacon :", beaconString, null);
    // Prepare speed label
    speedCache = vehicle.getSpeed();
    speedLabel = addTextField(destinationSpringPanel, "Speed :", DECIMAL_PLACES1.format(speedCache) + " km/h", null);
    // Prepare elevation label for vehicle
    elevationCache = vehicle.getElevation();
    elevationLabel = addTextField(destinationSpringPanel, "Elevation :", DECIMAL_PLACES1.format(elevationCache) + " km", null);
    // Prepare driver label
    WebLabel driverLabel = new WebLabel("Driver :", WebLabel.RIGHT);
    destinationSpringPanel.add(driverLabel);
    // Prepare driver button and add it if vehicle has driver.
    driverCache = vehicle.getOperator();
    driverButton = new WebButton();
    driverButton.addActionListener(this);
    driverButton.setVisible(false);
    if (driverCache != null) {
        driverButton.setText(driverCache.getName());
        driverButton.setVisible(true);
    }
    // Prepare driver panel
    WebPanel driverPanel = new WebPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
    driverPanel.add(driverButton);
    destinationSpringPanel.add(driverPanel);
    // Lay out the spring panel.
    SpringUtilities.makeCompactGrid(destinationSpringPanel, // rows, cols
    9, // rows, cols
    2, // initX, initY
    30, // initX, initY
    10, XPAD_DEFAULT, // xPad, yPad
    YPAD_DEFAULT);
}
Also used : JPanel(javax.swing.JPanel) ImageIcon(javax.swing.ImageIcon) NavPoint(org.mars_sim.msp.core.person.ai.mission.NavPoint) FlowLayout(java.awt.FlowLayout) Insets(java.awt.Insets) WebButton(com.alee.laf.button.WebButton) BevelBorder(javax.swing.border.BevelBorder) WebLabel(com.alee.laf.label.WebLabel) BorderLayout(java.awt.BorderLayout) SpringLayout(javax.swing.SpringLayout) WebPanel(com.alee.laf.panel.WebPanel) Mission(org.mars_sim.msp.core.person.ai.mission.Mission) TravelMission(org.mars_sim.msp.core.person.ai.mission.TravelMission) VehicleMission(org.mars_sim.msp.core.person.ai.mission.VehicleMission) EmptyBorder(javax.swing.border.EmptyBorder) LazyIcon(com.alee.managers.icon.LazyIcon) VehicleMission(org.mars_sim.msp.core.person.ai.mission.VehicleMission)

Aggregations

BevelBorder (javax.swing.border.BevelBorder)51 JPanel (javax.swing.JPanel)18 JScrollPane (javax.swing.JScrollPane)14 Dimension (java.awt.Dimension)13 ActionEvent (java.awt.event.ActionEvent)13 JLabel (javax.swing.JLabel)13 BorderLayout (java.awt.BorderLayout)12 JButton (javax.swing.JButton)11 MouseAdapter (java.awt.event.MouseAdapter)10 MouseEvent (java.awt.event.MouseEvent)10 FlowLayout (java.awt.FlowLayout)9 Insets (java.awt.Insets)9 JPopupMenu (javax.swing.JPopupMenu)9 TitledBorder (javax.swing.border.TitledBorder)9 Font (java.awt.Font)8 IOException (java.io.IOException)8 JMenuItem (javax.swing.JMenuItem)8 Color (java.awt.Color)7 EtchedBorder (javax.swing.border.EtchedBorder)7 ActionListener (java.awt.event.ActionListener)6