Example usage for javax.swing JToolBar setOpaque

List of usage examples for javax.swing JToolBar setOpaque

Introduction

In this page you can find the example usage for javax.swing JToolBar setOpaque.

Prototype

@BeanProperty(expert = true, description = "The component's opacity")
public void setOpaque(boolean isOpaque) 

Source Link

Document

If true the component paints every pixel within its bounds.

Usage

From source file:Main.java

/**
 * Populates a {@link JToolBar} with the list items and {@link ActionMap}.
 * //from   w  w w.j a  va 2s  .  co  m
 * @param toolBar
 * @param actionMap
 * @param items
 */
public static void populate(JToolBar toolBar, ActionMap actionMap, List<?> items) {
    toolBar.setOpaque(false);
    for (Object item : items) {
        if (item instanceof Component) {
            toolBar.add((Component) item);
        } else if (item == null) {
            toolBar.addSeparator();
        } else {
            final Action action = item instanceof Action ? (Action) item : actionMap.get(item);
            final AbstractButton button = createToolbarItem(action);
            toolBar.add(button);
        }
    }
}

From source file:dk.dma.epd.common.prototype.gui.voct.VOCTAdditionalInfoPanel.java

/**
 * Constructor// ww w . j av a2 s. c  om
 * 
 * @param compactLayout
 *            if false, there will be message type selectors in the panel
 */
public VOCTAdditionalInfoPanel(boolean compactLayout) {
    super(new BorderLayout());

    EPD.getInstance().getVoctHandler().addVoctSarInfoListener(this);

    // Prepare the title header
    titleHeader.setBackground(getBackground().darker());
    titleHeader.setOpaque(true);
    titleHeader.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    titleHeader.setHorizontalAlignment(SwingConstants.CENTER);
    add(titleHeader, BorderLayout.NORTH);

    // Add messages panel
    scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    messagesPanel.setBackground(UIManager.getColor("List.background"));
    messagesPanel.setOpaque(false);
    messagesPanel.setLayout(new GridBagLayout());
    messagesPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    add(scrollPane, BorderLayout.CENTER);

    JPanel sendPanel = new JPanel(new GridBagLayout());
    add(sendPanel, BorderLayout.SOUTH);
    Insets insets = new Insets(2, 2, 2, 2);

    // Add text area
    // if (false) {
    // messageText = new JTextField();
    // ((JTextField) messageText).addActionListener(this);
    // sendPanel.add(messageText, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, NORTH, BOTH, insets, 0, 0));
    //
    // } else {
    messageText = new JTextArea();
    JScrollPane scrollPane2 = new JScrollPane(messageText);
    scrollPane2.setPreferredSize(new Dimension(100, 50));
    scrollPane2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane2.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    sendPanel.add(scrollPane2, new GridBagConstraints(0, 0, 1, 2, 1.0, 1.0, NORTH, BOTH, insets, 0, 0));
    // }

    // Add buttons
    // ButtonGroup group = new ButtonGroup();

    if (!compactLayout) {
        JToolBar msgTypePanel = new JToolBar();
        msgTypePanel.setBorderPainted(false);
        msgTypePanel.setOpaque(true);
        msgTypePanel.setFloatable(false);
        sendPanel.add(msgTypePanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, NORTH, NONE, insets, 0, 0));

    }

    if (compactLayout) {
        addBtn = new JButton("Add to Log");
        sendPanel.add(addBtn, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, NORTH, NONE, insets, 0, 0));
    }
    // addBtn.setEnabled(false);
    // messageText.setEditable(false);
    addBtn.addActionListener(this);
}

From source file:aurelienribon.gdxsetupui.ui.panels.LibrarySelectionPanel.java

private void buildLibraryPanel(final String libraryName) {
    ActionListener nameChkAL = new ActionListener() {
        @Override//from  w w  w . j  a  va  2  s. co  m
        public void actionPerformed(ActionEvent e) {
            if (((CompactCheckBox) e.getSource()).isSelected()) {
                if (!Ctx.cfgSetup.libraries.contains(libraryName))
                    Ctx.cfgSetup.libraries.add(libraryName);
                if (!Ctx.cfgUpdate.libraries.contains(libraryName))
                    Ctx.cfgUpdate.libraries.add(libraryName);
            } else {
                Ctx.cfgSetup.libraries.remove(libraryName);
                Ctx.cfgUpdate.libraries.remove(libraryName);
            }

            Ctx.fireCfgSetupChanged();
            Ctx.fireCfgUpdateChanged();
        }
    };

    Action infoAction = new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent e) {
            showInfo(libraryName);
        }
    };
    Action browseAction = new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent e) {
            browse(libraryName);
        }
    };
    Action getStableAction = new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent e) {
            getStable(libraryName);
        }
    };
    Action getLatestAction = new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent e) {
            getLatest(libraryName);
        }
    };

    LibraryDef def = Ctx.libs.getDef(libraryName);

    CompactCheckBox nameChk = new CompactCheckBox(def.name + " ");
    JLabel html5Label = new JLabel(Res.getImage("gfx/ic_html5.png"));
    JButton infoBtn = new JButton(infoAction);
    JButton browseBtn = new JButton(browseAction);
    JButton getStableBtn = new JButton(getStableAction);
    JButton getLatestBtn = new JButton(getLatestAction);

    nameChk.addActionListener(nameChkAL);
    nameChk.setForeground(LIB_NOTFOUND_COLOR);
    html5Label.setToolTipText("Compatible with HTML backend");
    infoBtn.setIcon(Res.getImage("gfx/ic_info.png"));
    browseBtn.setIcon(Res.getImage("gfx/ic_browse.png"));
    getStableBtn.setIcon(Res.getImage("gfx/ic_download_stable.png"));
    getLatestBtn.setIcon(Res.getImage("gfx/ic_download_nightlies.png"));
    infoBtn.setFocusable(false);
    browseBtn.setFocusable(false);
    getStableBtn.setFocusable(false);
    getLatestBtn.setFocusable(false);

    JToolBar toolBar = new JToolBar();
    toolBar.setOpaque(false);
    toolBar.setFloatable(false);
    toolBar.add(Box.createHorizontalGlue());
    toolBar.add(infoBtn);
    toolBar.add(browseBtn);
    if (def.stableUrl != null)
        toolBar.add(getStableBtn);
    else
        toolBar.add(Box.createHorizontalStrut(libgdxGetStableBtn.getPreferredSize().width));
    if (def.latestUrl != null)
        toolBar.add(getLatestBtn);
    else
        toolBar.add(Box.createHorizontalStrut(libgdxGetNightliesBtn.getPreferredSize().width));

    JPanel leftPanel = new JPanel(new BorderLayout());
    leftPanel.setOpaque(false);
    leftPanel.add(nameChk, BorderLayout.CENTER);
    if (def.gwtModuleName != null)
        leftPanel.add(html5Label, BorderLayout.EAST);

    JPanel panel = new JPanel(new BorderLayout());
    panel.setMaximumSize(new Dimension(Integer.MAX_VALUE, 25));
    panel.setOpaque(false);
    panel.add(leftPanel, BorderLayout.WEST);
    panel.add(toolBar, BorderLayout.CENTER);

    librariesPanel.add(panel);

    Style.apply(librariesPanel, style);
    libsNamesCmps.put(libraryName, nameChk);
}

From source file:dk.dma.epd.common.prototype.gui.notification.ChatServicePanel.java

/**
 * Constructor//from   ww  w . j  a  v a2  s . co  m
 * 
 * @param compactLayout
 *            if false, there will be message type selectors in the panel
 */
public ChatServicePanel(boolean compactLayout) {
    super(new BorderLayout());

    // Prepare the title header
    titleHeader.setBackground(getBackground().darker());
    titleHeader.setOpaque(true);
    titleHeader.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    titleHeader.setHorizontalAlignment(SwingConstants.CENTER);
    add(titleHeader, BorderLayout.NORTH);

    // Add messages panel
    scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    messagesPanel.setBackground(UIManager.getColor("List.background"));
    messagesPanel.setOpaque(false);
    messagesPanel.setLayout(new GridBagLayout());
    messagesPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    add(scrollPane, BorderLayout.CENTER);

    JPanel sendPanel = new JPanel(new GridBagLayout());
    add(sendPanel, BorderLayout.SOUTH);
    Insets insets = new Insets(2, 2, 2, 2);

    // Add text area
    if (compactLayout) {
        messageText = new JTextField();
        ((JTextField) messageText).addActionListener(this);
        sendPanel.add(messageText, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, NORTH, BOTH, insets, 0, 0));

    } else {
        messageText = new JTextArea();
        JScrollPane scrollPane2 = new JScrollPane(messageText);
        scrollPane2.setPreferredSize(new Dimension(100, 50));
        scrollPane2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        scrollPane2.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
        sendPanel.add(scrollPane2, new GridBagConstraints(0, 0, 1, 2, 1.0, 1.0, NORTH, BOTH, insets, 0, 0));
    }

    // Add buttons
    ButtonGroup group = new ButtonGroup();
    messageTypeBtn = createMessageTypeButton("Send messages", ICON_MESSAGE, true, group);
    warningTypeBtn = createMessageTypeButton("Send warnings", ICON_WARNING, false, group);
    alertTypeBtn = createMessageTypeButton("Send alerts", ICON_ALERT, false, group);

    if (!compactLayout) {
        JToolBar msgTypePanel = new JToolBar();
        msgTypePanel.setBorderPainted(false);
        msgTypePanel.setOpaque(true);
        msgTypePanel.setFloatable(false);
        sendPanel.add(msgTypePanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, NORTH, NONE, insets, 0, 0));
        msgTypePanel.add(messageTypeBtn);
        msgTypePanel.add(warningTypeBtn);
        msgTypePanel.add(alertTypeBtn);
    }

    if (compactLayout) {
        sendBtn = new JButton("Send");
        sendPanel.add(sendBtn, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, NORTH, NONE, insets, 0, 0));
    } else {
        sendBtn = new JButton("Send", ICON_MESSAGE);
        sendBtn.setPreferredSize(new Dimension(100, sendBtn.getPreferredSize().height));
        sendPanel.add(sendBtn, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, NORTH, NONE, insets, 0, 0));
    }
    sendBtn.setEnabled(false);
    messageText.setEditable(false);
    sendBtn.addActionListener(this);
}

From source file:com.net2plan.gui.tools.GUINetworkDesign.java

private JPanel configureLeftBottomPanel() {
    this.focusPanel = new FocusPane(this);
    final JPanel focusPanelContainer = new JPanel(new BorderLayout());
    final JToolBar navigationToolbar = new JToolBar(JToolBar.VERTICAL);
    navigationToolbar.setRollover(true);
    navigationToolbar.setFloatable(false);
    navigationToolbar.setOpaque(false);

    final JButton btn_pickNavigationUndo, btn_pickNavigationRedo;

    btn_pickNavigationUndo = new JButton("");
    btn_pickNavigationUndo/* w w  w .j  ava 2s  .c o  m*/
            .setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/undoPick.png")));
    btn_pickNavigationUndo.setToolTipText("Navigate back to the previous element picked");
    btn_pickNavigationRedo = new JButton("");
    btn_pickNavigationRedo
            .setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/redoPick.png")));
    btn_pickNavigationRedo.setToolTipText("Navigate forward to the next element picked");

    final ActionListener action = e -> {
        Pair<NetworkElement, Pair<Demand, Link>> backOrForward;
        do {
            backOrForward = (e.getSource() == btn_pickNavigationUndo)
                    ? GUINetworkDesign.this.getVisualizationState().getPickNavigationBackElement()
                    : GUINetworkDesign.this.getVisualizationState().getPickNavigationForwardElement();
            if (backOrForward == null)
                break;
            final NetworkElement ne = backOrForward.getFirst(); // For network elements
            final Pair<Demand, Link> fr = backOrForward.getSecond(); // For forwarding rules
            if (ne != null) {
                if (ne.getNetPlan() != GUINetworkDesign.this.getDesign())
                    continue;
                if (ne.getNetPlan() == null)
                    continue;
                break;
            } else if (fr != null) {
                if (fr.getFirst().getNetPlan() != GUINetworkDesign.this.getDesign())
                    continue;
                if (fr.getFirst().getNetPlan() == null)
                    continue;
                if (fr.getSecond().getNetPlan() != GUINetworkDesign.this.getDesign())
                    continue;
                if (fr.getSecond().getNetPlan() == null)
                    continue;
                break;
            } else
                break; // null,null => reset picked state
        } while (true);
        if (backOrForward != null) {
            if (backOrForward.getFirst() != null)
                GUINetworkDesign.this.getVisualizationState().pickElement(backOrForward.getFirst());
            else if (backOrForward.getSecond() != null)
                GUINetworkDesign.this.getVisualizationState().pickForwardingRule(backOrForward.getSecond());
            else
                GUINetworkDesign.this.getVisualizationState().resetPickedState();

            GUINetworkDesign.this.updateVisualizationAfterPick();
        }
    };

    btn_pickNavigationUndo.addActionListener(action);
    btn_pickNavigationRedo.addActionListener(action);

    btn_pickNavigationRedo.setFocusable(false);
    btn_pickNavigationUndo.setFocusable(false);

    navigationToolbar.add(btn_pickNavigationUndo);
    navigationToolbar.add(btn_pickNavigationRedo);

    final JScrollPane scPane = new JScrollPane(focusPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    scPane.getVerticalScrollBar().setUnitIncrement(20);
    scPane.getHorizontalScrollBar().setUnitIncrement(20);
    scPane.setBorder(BorderFactory.createEmptyBorder());

    // Control the scroll
    scPane.getHorizontalScrollBar().addAdjustmentListener(e -> {
        // Repaints the panel each time the horizontal scroll bar is moves, in order to avoid ghosting.
        focusPanelContainer.revalidate();
        focusPanelContainer.repaint();
    });

    focusPanelContainer.add(navigationToolbar, BorderLayout.WEST);
    focusPanelContainer.add(scPane, BorderLayout.CENTER);

    JPanel pane = new JPanel(new MigLayout("fill, insets 0 0 0 0"));
    pane.setBorder(BorderFactory.createTitledBorder(new LineBorder(Color.BLACK), "Focus panel"));

    pane.add(focusPanelContainer, "grow");
    return pane;
}

From source file:com.net2plan.gui.utils.topologyPane.TopologyPanel.java

/**
 * Default constructor./*from w ww .ja v  a 2s.  c  om*/
 *
 * @param callback               Topology callback listening plugin events
 * @param defaultDesignDirectory Default location for design {@code .n2p} files (it may be null, then default is equal to {@code net2planFolder/workspace/data/networkTopologies})
 * @param defaultDemandDirectory Default location for design {@code .n2p} files (it may be null, then default is equal to {@code net2planFolder/workspace/data/trafficMatrices})
 * @param canvasType             Canvas type (i.e. JUNG)
 * @param plugins                List of plugins to be included (it may be null)
 */
public TopologyPanel(final IVisualizationCallback callback, File defaultDesignDirectory,
        File defaultDemandDirectory, Class<? extends ITopologyCanvas> canvasType,
        List<ITopologyCanvasPlugin> plugins) {
    File currentDir = SystemUtils.getCurrentDir();

    this.callback = callback;
    this.defaultDesignDirectory = defaultDesignDirectory == null ? new File(
            currentDir + SystemUtils.getDirectorySeparator() + "workspace" + SystemUtils.getDirectorySeparator()
                    + "data" + SystemUtils.getDirectorySeparator() + "networkTopologies")
            : defaultDesignDirectory;
    this.defaultDemandDirectory = defaultDemandDirectory == null ? new File(
            currentDir + SystemUtils.getDirectorySeparator() + "workspace" + SystemUtils.getDirectorySeparator()
                    + "data" + SystemUtils.getDirectorySeparator() + "trafficMatrices")
            : defaultDemandDirectory;
    this.multilayerControlPanel = new MultiLayerControlPanel(callback);

    try {
        canvas = canvasType.getDeclaredConstructor(IVisualizationCallback.class, TopologyPanel.class)
                .newInstance(callback, this);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }

    if (plugins != null)
        for (ITopologyCanvasPlugin plugin : plugins)
            addPlugin(plugin);

    setLayout(new BorderLayout());

    JToolBar toolbar = new JToolBar();
    toolbar.setRollover(true);
    toolbar.setFloatable(false);
    toolbar.setOpaque(false);
    toolbar.setBorderPainted(false);

    JPanel topPanel = new JPanel(new BorderLayout());
    topPanel.add(toolbar, BorderLayout.NORTH);

    add(topPanel, BorderLayout.NORTH);

    JComponent canvasComponent = canvas.getCanvasComponent();

    canvasPanel = new JPanel(new BorderLayout());
    canvasComponent.setBorder(LineBorder.createBlackLineBorder());

    JToolBar multiLayerToolbar = new JToolBar(JToolBar.VERTICAL);
    multiLayerToolbar.setRollover(true);
    multiLayerToolbar.setFloatable(false);
    multiLayerToolbar.setOpaque(false);

    canvasPanel.add(canvasComponent, BorderLayout.CENTER);
    canvasPanel.add(multiLayerToolbar, BorderLayout.WEST);
    add(canvasPanel, BorderLayout.CENTER);

    btn_load = new JButton();
    btn_load.setToolTipText("Load a network design");
    btn_loadDemand = new JButton();
    btn_loadDemand.setToolTipText("Load a traffic demand set");
    btn_save = new JButton();
    btn_save.setToolTipText("Save current state to a file");
    btn_zoomIn = new JButton();
    btn_zoomIn.setToolTipText("Zoom in");
    btn_zoomOut = new JButton();
    btn_zoomOut.setToolTipText("Zoom out");
    btn_zoomAll = new JButton();
    btn_zoomAll.setToolTipText("Zoom all");
    btn_takeSnapshot = new JButton();
    btn_takeSnapshot.setToolTipText("Take a snapshot of the canvas");
    btn_showNodeNames = new JToggleButton();
    btn_showNodeNames.setToolTipText("Show/hide node names");
    btn_showLinkIds = new JToggleButton();
    btn_showLinkIds.setToolTipText(
            "Show/hide link utilization, measured as the ratio between the total traffic in the link (including that in protection segments) and total link capacity (including that reserved by protection segments)");
    btn_showNonConnectedNodes = new JToggleButton();
    btn_showNonConnectedNodes.setToolTipText("Show/hide non-connected nodes");
    btn_increaseNodeSize = new JButton();
    btn_increaseNodeSize.setToolTipText("Increase node size");
    btn_decreaseNodeSize = new JButton();
    btn_decreaseNodeSize.setToolTipText("Decrease node size");
    btn_increaseFontSize = new JButton();
    btn_increaseFontSize.setToolTipText("Increase font size");
    btn_decreaseFontSize = new JButton();
    btn_decreaseFontSize.setToolTipText("Decrease font size");
    /* Multilayer buttons */
    btn_increaseInterLayerDistance = new JButton();
    btn_increaseInterLayerDistance
            .setToolTipText("Increase the distance between layers (when more than one layer is visible)");
    btn_decreaseInterLayerDistance = new JButton();
    btn_decreaseInterLayerDistance
            .setToolTipText("Decrease the distance between layers (when more than one layer is visible)");
    btn_showLowerLayerInfo = new JToggleButton();
    btn_showLowerLayerInfo
            .setToolTipText("Shows the links in lower layers that carry traffic of the picked element");
    btn_showLowerLayerInfo.setSelected(getVisualizationState().isShowInCanvasLowerLayerPropagation());
    btn_showUpperLayerInfo = new JToggleButton();
    btn_showUpperLayerInfo.setToolTipText(
            "Shows the links in upper layers that carry traffic that appears in the picked element");
    btn_showUpperLayerInfo.setSelected(getVisualizationState().isShowInCanvasUpperLayerPropagation());
    btn_showThisLayerInfo = new JToggleButton();
    btn_showThisLayerInfo.setToolTipText(
            "Shows the links in the same layer as the picked element, that carry traffic that appears in the picked element");
    btn_showThisLayerInfo.setSelected(getVisualizationState().isShowInCanvasThisLayerPropagation());
    btn_npChangeUndo = new JButton();
    btn_npChangeUndo.setToolTipText(
            "Navigate back to the previous state of the network (last time the network design was changed)");
    btn_npChangeRedo = new JButton();
    btn_npChangeRedo.setToolTipText(
            "Navigate forward to the next state of the network (when network design was changed");

    btn_osmMap = new JToggleButton();
    btn_osmMap.setToolTipText(
            "Toggle between on/off the OSM support. An internet connection is required in order for this to work.");
    btn_tableControlWindow = new JButton();
    btn_tableControlWindow.setToolTipText("Show the network topology control window.");

    // MultiLayer control window
    JPopupMenu multiLayerPopUp = new JPopupMenu();
    multiLayerPopUp.add(multilayerControlPanel);
    JPopUpButton btn_multilayer = new JPopUpButton("", multiLayerPopUp);

    btn_reset = new JButton("Reset");
    btn_reset.setToolTipText("Reset the user interface");
    btn_reset.setMnemonic(KeyEvent.VK_R);

    btn_load.setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/loadDesign.png")));
    btn_loadDemand.setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/loadDemand.png")));
    btn_save.setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/saveDesign.png")));
    btn_showNodeNames
            .setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/showNodeName.png")));
    btn_showLinkIds
            .setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/showLinkUtilization.png")));
    btn_showNonConnectedNodes.setIcon(
            new ImageIcon(TopologyPanel.class.getResource("/resources/gui/showNonConnectedNodes.png")));
    //btn_whatIfActivated.setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/showNonConnectedNodes.png")));
    btn_zoomIn.setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/zoomIn.png")));
    btn_zoomOut.setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/zoomOut.png")));
    btn_zoomAll.setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/zoomAll.png")));
    btn_takeSnapshot.setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/takeSnapshot.png")));
    btn_increaseNodeSize
            .setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/increaseNode.png")));
    btn_decreaseNodeSize
            .setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/decreaseNode.png")));
    btn_increaseFontSize
            .setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/increaseFont.png")));
    btn_decreaseFontSize
            .setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/decreaseFont.png")));
    btn_increaseInterLayerDistance.setIcon(
            new ImageIcon(TopologyPanel.class.getResource("/resources/gui/increaseLayerDistance.png")));
    btn_decreaseInterLayerDistance.setIcon(
            new ImageIcon(TopologyPanel.class.getResource("/resources/gui/decreaseLayerDistance.png")));
    btn_multilayer
            .setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/showLayerControl.png")));
    btn_showThisLayerInfo
            .setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/showLayerPropagation.png")));
    btn_showUpperLayerInfo.setIcon(
            new ImageIcon(TopologyPanel.class.getResource("/resources/gui/showLayerUpperPropagation.png")));
    btn_showLowerLayerInfo.setIcon(
            new ImageIcon(TopologyPanel.class.getResource("/resources/gui/showLayerLowerPropagation.png")));
    btn_tableControlWindow
            .setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/showControl.png")));
    btn_osmMap.setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/showOSM.png")));
    btn_npChangeUndo.setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/undoButton.png")));
    btn_npChangeRedo.setIcon(new ImageIcon(TopologyPanel.class.getResource("/resources/gui/redoButton.png")));

    btn_load.addActionListener(this);
    btn_loadDemand.addActionListener(this);
    btn_save.addActionListener(this);
    btn_showNodeNames.addActionListener(this);
    btn_showLinkIds.addActionListener(this);
    btn_showNonConnectedNodes.addActionListener(this);
    btn_zoomIn.addActionListener(this);
    btn_zoomOut.addActionListener(this);
    btn_zoomAll.addActionListener(this);
    btn_takeSnapshot.addActionListener(this);
    btn_reset.addActionListener(this);
    btn_increaseInterLayerDistance.addActionListener(this);
    btn_decreaseInterLayerDistance.addActionListener(this);
    btn_showLowerLayerInfo.addActionListener(this);
    btn_showUpperLayerInfo.addActionListener(this);
    btn_showThisLayerInfo.addActionListener(this);
    btn_increaseNodeSize.addActionListener(this);
    btn_decreaseNodeSize.addActionListener(this);
    btn_increaseFontSize.addActionListener(this);
    btn_decreaseFontSize.addActionListener(this);
    btn_npChangeUndo.addActionListener(this);
    btn_npChangeRedo.addActionListener(this);
    btn_osmMap.addActionListener(this);
    btn_tableControlWindow.addActionListener(this);

    toolbar.add(btn_load);
    toolbar.add(btn_loadDemand);
    toolbar.add(btn_save);
    toolbar.add(new JToolBar.Separator());
    toolbar.add(btn_zoomIn);
    toolbar.add(btn_zoomOut);
    toolbar.add(btn_zoomAll);
    toolbar.add(btn_takeSnapshot);
    toolbar.add(new JToolBar.Separator());
    toolbar.add(btn_showNodeNames);
    toolbar.add(btn_showLinkIds);
    toolbar.add(btn_showNonConnectedNodes);
    toolbar.add(new JToolBar.Separator());
    toolbar.add(btn_increaseNodeSize);
    toolbar.add(btn_decreaseNodeSize);
    toolbar.add(btn_increaseFontSize);
    toolbar.add(btn_decreaseFontSize);
    toolbar.add(new JToolBar.Separator());
    toolbar.add(Box.createHorizontalGlue());
    toolbar.add(btn_osmMap);
    toolbar.add(btn_tableControlWindow);
    toolbar.add(btn_reset);

    multiLayerToolbar.add(new JToolBar.Separator());
    multiLayerToolbar.add(btn_multilayer);
    multiLayerToolbar.add(btn_increaseInterLayerDistance);
    multiLayerToolbar.add(btn_decreaseInterLayerDistance);
    multiLayerToolbar.add(btn_showLowerLayerInfo);
    multiLayerToolbar.add(btn_showUpperLayerInfo);
    multiLayerToolbar.add(btn_showThisLayerInfo);
    multiLayerToolbar.add(Box.createVerticalGlue());
    multiLayerToolbar.add(btn_npChangeUndo);
    multiLayerToolbar.add(btn_npChangeRedo);

    this.addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent e) {
            if (e.getComponent().getSize().getHeight() != 0 && e.getComponent().getSize().getWidth() != 0) {
                canvas.zoomAll();
            }
        }
    });

    List<Component> children = SwingUtils.getAllComponents(this);
    for (Component component : children)
        if (component instanceof AbstractButton)
            component.setFocusable(false);

    if (ErrorHandling.isDebugEnabled()) {
        canvas.getCanvasComponent().addMouseMotionListener(new MouseMotionAdapter() {
            @Override
            public void mouseMoved(MouseEvent e) {
                Point point = e.getPoint();
                position.setText("view = " + point + ", NetPlan coord = "
                        + canvas.getCanvasPointFromNetPlanPoint(point));
            }
        });

        position = new JLabel();
        add(position, BorderLayout.SOUTH);
    } else {
        position = null;
    }

    new FileDrop(canvasComponent, new LineBorder(Color.BLACK), new FileDrop.Listener() {
        @Override
        public void filesDropped(File[] files) {
            for (File file : files) {
                try {
                    if (!file.getName().toLowerCase(Locale.getDefault()).endsWith(".n2p"))
                        return;
                    loadDesignFromFile(file);
                    break;
                } catch (Throwable e) {
                    break;
                }
            }
        }
    });

    btn_showNodeNames.setSelected(getVisualizationState().isCanvasShowNodeNames());
    btn_showLinkIds.setSelected(getVisualizationState().isCanvasShowLinkLabels());
    btn_showNonConnectedNodes.setSelected(getVisualizationState().isCanvasShowNonConnectedNodes());

    final ITopologyCanvasPlugin popupPlugin = new PopupMenuPlugin(callback, this.canvas);
    addPlugin(new PanGraphPlugin(callback, canvas, MouseEvent.BUTTON1_MASK));
    if (callback.getVisualizationState().isNetPlanEditable() && getCanvas() instanceof JUNGCanvas)
        addPlugin(new AddLinkGraphPlugin(callback, canvas, MouseEvent.BUTTON1_MASK,
                MouseEvent.BUTTON1_MASK | MouseEvent.SHIFT_MASK));
    addPlugin(popupPlugin);
    if (callback.getVisualizationState().isNetPlanEditable())
        addPlugin(new MoveNodePlugin(callback, canvas, MouseEvent.BUTTON1_MASK | MouseEvent.CTRL_MASK));

    setBorder(BorderFactory.createTitledBorder(new LineBorder(Color.BLACK), "Network topology"));
    //        setAllowLoadTrafficDemand(callback.allowLoadTrafficDemands());
}

From source file:com.projity.pm.graphic.frames.GraphicManager.java

public void setToolBarAndMenus(final Container contentPane) {
    JToolBar toolBar;
    if (Environment.isRibbonUI()) {
        if (Environment.isNeedToRestart()) {
            contentPane.add(new JLabel(Messages.getString("Error.restart")), BorderLayout.CENTER);
            return;
        }//  w  w  w.j  ava  2s .  c  o m

        setRibbon((JRibbonFrame) container, getMenuManager());

        //         JToolBar viewToolBar = getMenuManager().getToolBar(MenuManager.VIEW_TOOL_BAR_WITH_NO_SUB_VIEW_OPTION);
        //         topTabs = new TabbedNavigation();
        //         JComponent tabs = topTabs.createContentPanel(getMenuManager(),viewToolBar,0,JTabbedPane.TOP,true);
        //         tabs.setAlignmentX(0.0f); // so it is left justified
        //
        //
        //          Box top = new Box(BoxLayout.Y_AXIS);
        //          JComponent bottom;
        //         top.add(tabs);
        //         bottom = new TabbedNavigation().createContentPanel(getMenuManager(),viewToolBar,1,JTabbedPane.BOTTOM,false);
        //         contentPane.add(top, BorderLayout.BEFORE_FIRST_LINE);
        //         contentPane.add(bottom,BorderLayout.AFTER_LAST_LINE);
        //         if (Environment.isNewLaf())
        //            contentPane.setBackground(Color.WHITE);

        //         if (Environment.isMac()){
        //            //System.setProperty("apple.laf.useScreenMenuBar","true");
        //            //System.setProperty("com.apple.mrj.application.apple.menu.about.name", Messages.getMetaString("Text.ShortTitle"));
        //            JMenuBar menu = getMenuManager().getMenu(Environment.getStandAlone()?MenuManager.MAC_STANDARD_MENU:MenuManager.SERVER_STANDARD_MENU);
        //            //((JComponent)menu).setBorder(BorderFactory.createEmptyBorder());
        //
        //            ((JFrame)container).setJMenuBar(menu);
        //            projectListMenu = (JMenu) menu.getComponent(5);
        //         }

    } else if (Environment.isNewLook()) {
        if (Environment.isNeedToRestart()) {
            contentPane.add(new JLabel(Messages.getString("Error.restart")), BorderLayout.CENTER);
            return;
        }

        toolBar = getMenuManager().getToolBar(MenuManager.BIG_TOOL_BAR);
        if (!getLafManager().isToolbarOpaque())
            toolBar.setOpaque(false);
        if (!isApplet())
            getMenuManager().setActionVisible(ACTION_FULL_SCREEN, false);

        if (Environment.isExternal()) // external users only see project team
            getMenuManager().setActionVisible(ACTION_TEAM_FILTER, false);

        toolBar.addSeparator(new Dimension(20, 20));
        toolBar.add(new Box.Filler(new Dimension(0, 0), new Dimension(0, 0),
                new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE)));
        toolBar.add(((DefaultFrameManager) getFrameManager()).getProjectComboPanel());
        toolBar.add(Box.createRigidArea(new Dimension(20, 20)));
        if (Environment.isNewLaf())
            toolBar.setBackground(Color.WHITE);
        toolBar.setFloatable(false);
        toolBar.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        Box top;
        JComponent bottom;

        top = new Box(BoxLayout.Y_AXIS);
        toolBar.setAlignmentX(0.0f); // so it is left justified
        top.add(toolBar);

        JToolBar viewToolBar = getMenuManager().getToolBar(MenuManager.VIEW_TOOL_BAR_WITH_NO_SUB_VIEW_OPTION);
        topTabs = new TabbedNavigation();
        JComponent tabs = topTabs.createContentPanel(getMenuManager(), viewToolBar, 0, JTabbedPane.TOP, true);
        tabs.setAlignmentX(0.0f); // so it is left justified

        top.add(tabs);
        bottom = new TabbedNavigation().createContentPanel(getMenuManager(), viewToolBar, 1, JTabbedPane.BOTTOM,
                false);
        contentPane.add(top, BorderLayout.BEFORE_FIRST_LINE);
        contentPane.add(bottom, BorderLayout.AFTER_LAST_LINE);
        if (Environment.isNewLaf())
            contentPane.setBackground(Color.WHITE);

        if (Environment.isMac()) {
            //System.setProperty("apple.laf.useScreenMenuBar","true");
            //System.setProperty("com.apple.mrj.application.apple.menu.about.name", Messages.getMetaString("Text.ShortTitle"));
            JMenuBar menu = getMenuManager().getMenu(Environment.getStandAlone() ? MenuManager.MAC_STANDARD_MENU
                    : MenuManager.SERVER_STANDARD_MENU);
            //((JComponent)menu).setBorder(BorderFactory.createEmptyBorder());

            ((JFrame) container).setJMenuBar(menu);
            projectListMenu = (JMenu) menu.getComponent(5);
        }

    } else {

        toolBar = getMenuManager().getToolBar(
                Environment.isMac() ? MenuManager.MAC_STANDARD_TOOL_BAR : MenuManager.STANDARD_TOOL_BAR);
        filterToolBarManager = FilterToolBarManager.create(getMenuManager());
        filterToolBarManager.addButtons(toolBar);
        contentPane.add(toolBar, BorderLayout.BEFORE_FIRST_LINE);
        JToolBar viewToolBar = getMenuManager().getToolBar(MenuManager.VIEW_TOOL_BAR);
        viewToolBar.setOrientation(JToolBar.VERTICAL);
        viewToolBar.setRollover(true);
        contentPane.add(viewToolBar, BorderLayout.WEST);

        JMenuBar menu = getMenuManager().getMenu(Environment.getStandAlone()
                ? (Environment.isMac() ? MenuManager.MAC_STANDARD_MENU : MenuManager.STANDARD_MENU)
                : MenuManager.SERVER_STANDARD_MENU);

        if (!Environment.isMac()) {
            ((JComponent) menu).setBorder(BorderFactory.createEmptyBorder());
            JMenuItem logo = (JMenuItem) menu.getComponent(0);
            logo.setBorder(BorderFactory.createEmptyBorder());
            logo.setMaximumSize(new Dimension(124, 52));
            logo.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        }
        ((JFrame) container).setJMenuBar(menu);
        projectListMenu = (JMenu) menu.getComponent(Environment.isMac() ? 5 : 6);
    }

    //accelerators
    addCtrlAccel(KeyEvent.VK_G, ACTION_GOTO, null);
    addCtrlAccel(KeyEvent.VK_L, ACTION_GOTO, null);
    addCtrlAccel(KeyEvent.VK_F, ACTION_FIND, null);
    addCtrlAccel(KeyEvent.VK_Z, ACTION_UNDO, null); //- Sanhita
    addCtrlAccel(KeyEvent.VK_Y, ACTION_REDO, null);
    addCtrlAccel(KeyEvent.VK_N, ACTION_NEW_PROJECT, null);
    addCtrlAccel(KeyEvent.VK_O, ACTION_OPEN_PROJECT, null);
    addCtrlAccel(KeyEvent.VK_S, ACTION_SAVE_PROJECT, null);
    addCtrlAccel(KeyEvent.VK_P, ACTION_PRINT, null); //-Sanhita
    addCtrlAccel(KeyEvent.VK_I, ACTION_INSERT_TASK, null);
    addCtrlAccel(KeyEvent.VK_PERIOD, ACTION_INDENT, null);
    addCtrlAccel(KeyEvent.VK_COMMA, ACTION_OUTDENT, null);
    addCtrlAccel(KeyEvent.VK_PLUS, ACTION_EXPAND, new ExpandAction());
    addCtrlAccel(KeyEvent.VK_ADD, ACTION_EXPAND, new ExpandAction());
    addCtrlAccel(KeyEvent.VK_EQUALS, ACTION_EXPAND, new ExpandAction());
    addCtrlAccel(KeyEvent.VK_MINUS, ACTION_COLLAPSE, new CollapseAction());
    addCtrlAccel(KeyEvent.VK_SUBTRACT, ACTION_COLLAPSE, new CollapseAction());

    // To force a recalculation. This normally shouldn't be needed.
    addCtrlAccel(KeyEvent.VK_R, ACTION_RECALCULATE, new RecalculateAction());
}

From source file:org.openmicroscopy.shoola.agents.metadata.editor.DocComponent.java

/** Builds and lays out the UI. */
private void buildGUI() {
    setBackground(UIUtilities.BACKGROUND_COLOR);
    setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
    add(label);//w  w w. j  a  va  2 s.com
    JToolBar bar = new JToolBar();
    bar.setBackground(UIUtilities.BACKGROUND_COLOR);
    bar.setFloatable(false);
    bar.setRollover(true);
    bar.setBorder(null);
    bar.setOpaque(true);
    boolean b = setControlsEnabled(data != null);
    int count = 0;
    if (editButton != null)
        count++;
    if (unlinkButton != null)
        count++;
    if (downloadButton != null)
        count++;
    if (infoButton != null)
        count++;
    if (openButton != null)
        count++;
    if (count > 0 && data != null) {
        menuButton.setEnabled(true);
        if (model.isAcrossGroups())
            menuButton.setEnabled(false);
        bar.add(menuButton);
        if (!b)
            bar.add(Box.createHorizontalStrut(8));
        add(bar);
    }
}

From source file:org.openmicroscopy.shoola.env.ui.ActivityComponent.java

/** 
 * Invokes when the activity end. /*w w  w . ja  v  a2  s.c om*/
 * 
 * @param result The result of the activity.
 */
public void endActivity(Object result) {
    this.result = result;
    boolean busy = status.isBusy();
    reset();
    if (result instanceof Map) {
        Map<String, Object> m = convertResult((Map<String, Object>) result);
        int size = m.size();
        this.result = m;
        remove(resultPane);
        Color c = getBackground();
        if (size == 0) {
            JToolBar row = new JToolBar();
            row.setOpaque(false);
            row.setFloatable(false);
            row.setBorder(null);
            row.setBackground(c);
            JButton button;
            if (errorObject != null) {
                button = createButton(ActivityResultRow.ERROR_TEXT, ERROR, this);
                button.addMouseListener(new MouseAdapter() {

                    public void mouseReleased(MouseEvent e) {
                        showMenu((JComponent) e.getSource(), ERROR, e.getX(), e.getY());
                    }
                });
                row.add(button);
            }
            if (infoObject != null) {
                button = createButton(ActivityResultRow.INFO_TEXT, INFO, this);
                button.addMouseListener(new MouseAdapter() {

                    public void mouseReleased(MouseEvent e) {
                        showMenu((JComponent) e.getSource(), INFO, e.getX(), e.getY());
                    }
                });
                row.add(button);
            }
            add(row, paneIndex);
        } else {
            Entry<String, Object> entry;
            Iterator<Entry<String, Object>> i = m.entrySet().iterator();
            ActivityResultRow row = null;
            JPanel content = new JPanel();
            content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));

            content.setBackground(c);
            int index = 0;
            int max = 2;
            JButton moreButton = null;
            while (i.hasNext()) {
                entry = (Entry<String, Object>) i.next();
                this.result = entry.getValue();
                row = new ActivityResultRow((String) entry.getKey(), entry.getValue(), this);
                row.setBackground(c);
                row.addPropertyChangeListener(listener);
                resultButtons.add(row);
                if (index < max)
                    content.add(row);
                else {
                    if (moreButton == null) {
                        moreButton = createButton("" + (m.size() - max) + " more", ALL_RESULT, this);
                        content.add(moreButton);
                    }
                }
                index++;
            }

            if (m.size() == 1)
                add(row, paneIndex);
            else
                add(content, paneIndex);
            resultPane = content;
        }

        repaint();
    }

    firePropertyChange(UNREGISTER_ACTIVITY_PROPERTY, null, this);
    notifyActivityEnd();
    //Post an event to 
    //if (busy) {
    EventBus bus = registry.getEventBus();
    bus.post(new ActivityProcessEvent(this, busy));
    //}
}

From source file:org.tinymediamanager.ui.movies.MoviePanel.java

/**
 * Create the panel./*from   www. j a  va2  s . c  om*/
 */
public MoviePanel() {
    super();
    // load movielist
    LOGGER.debug("loading MovieList");
    movieList = MovieList.getInstance();
    sortedMovies = new SortedList<>(GlazedListsSwing.swingThreadProxyList(movieList.getMovies()),
            new MovieComparator());
    sortedMovies.setMode(SortedList.AVOID_MOVING_ELEMENTS);

    // build menu
    menu = new JMenu(BUNDLE.getString("tmm.movies")); //$NON-NLS-1$
    JFrame mainFrame = MainWindow.getFrame();
    JMenuBar menuBar = mainFrame.getJMenuBar();
    menuBar.add(menu);

    setLayout(new FormLayout(
            new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("850px:grow"),
                    FormFactory.RELATED_GAP_COLSPEC, },
            new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("500px:grow"), }));

    splitPaneHorizontal = new JSplitPane();
    splitPaneHorizontal.setContinuousLayout(true);
    add(splitPaneHorizontal, "2, 2, fill, fill");

    JPanel panelMovieList = new JPanel();
    splitPaneHorizontal.setLeftComponent(panelMovieList);
    panelMovieList.setLayout(new FormLayout(
            new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"),
                    ColumnSpec.decode("default:grow"), FormFactory.RELATED_GAP_COLSPEC,
                    FormFactory.DEFAULT_COLSPEC, },
            new RowSpec[] { RowSpec.decode("26px"), FormFactory.RELATED_GAP_ROWSPEC,
                    RowSpec.decode("fill:max(200px;default):grow"), FormFactory.RELATED_GAP_ROWSPEC,
                    FormFactory.DEFAULT_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, }));

    JToolBar toolBar = new JToolBar();
    toolBar.setRollover(true);
    toolBar.setFloatable(false);
    toolBar.setOpaque(false);
    panelMovieList.add(toolBar, "2, 1, left, fill");

    // udpate datasource
    // toolBar.add(actionUpdateDataSources);
    final JSplitButton buttonUpdateDatasource = new JSplitButton(IconManager.REFRESH);
    // temp fix for size of the button
    buttonUpdateDatasource.setText("   ");
    buttonUpdateDatasource.setHorizontalAlignment(JButton.LEFT);
    // buttonScrape.setMargin(new Insets(2, 2, 2, 24));
    buttonUpdateDatasource.setSplitWidth(18);
    buttonUpdateDatasource.setToolTipText(BUNDLE.getString("update.datasource")); //$NON-NLS-1$
    buttonUpdateDatasource.addSplitButtonActionListener(new SplitButtonActionListener() {
        public void buttonClicked(ActionEvent e) {
            actionUpdateDataSources.actionPerformed(e);
        }

        public void splitButtonClicked(ActionEvent e) {
            // build the popupmenu on the fly
            buttonUpdateDatasource.getPopupMenu().removeAll();
            JMenuItem item = new JMenuItem(actionUpdateDataSources2);
            buttonUpdateDatasource.getPopupMenu().add(item);
            buttonUpdateDatasource.getPopupMenu().addSeparator();
            for (String ds : MovieModuleManager.MOVIE_SETTINGS.getMovieDataSource()) {
                buttonUpdateDatasource.getPopupMenu()
                        .add(new JMenuItem(new MovieUpdateSingleDatasourceAction(ds)));
            }

            buttonUpdateDatasource.getPopupMenu().pack();
        }
    });

    JPopupMenu popup = new JPopupMenu("popup");
    buttonUpdateDatasource.setPopupMenu(popup);
    toolBar.add(buttonUpdateDatasource);

    JSplitButton buttonScrape = new JSplitButton(IconManager.SEARCH);
    // temp fix for size of the button
    buttonScrape.setText("   ");
    buttonScrape.setHorizontalAlignment(JButton.LEFT);
    // buttonScrape.setMargin(new Insets(2, 2, 2, 24));
    buttonScrape.setSplitWidth(18);
    buttonScrape.setToolTipText(BUNDLE.getString("movie.scrape.selected")); //$NON-NLS-1$

    // register for listener
    buttonScrape.addSplitButtonActionListener(new SplitButtonActionListener() {
        public void buttonClicked(ActionEvent e) {
            actionScrape.actionPerformed(e);
        }

        public void splitButtonClicked(ActionEvent e) {
        }
    });

    popup = new JPopupMenu("popup");
    JMenuItem item = new JMenuItem(actionScrape2);
    popup.add(item);
    item = new JMenuItem(actionScrapeUnscraped);
    popup.add(item);
    item = new JMenuItem(actionScrapeSelected);
    popup.add(item);
    buttonScrape.setPopupMenu(popup);
    toolBar.add(buttonScrape);

    toolBar.add(actionEditMovie);

    btnRen = new JButton("REN");
    btnRen.setAction(actionRename);
    toolBar.add(btnRen);

    btnMediaInformation = new JButton("MI");
    btnMediaInformation.setAction(actionMediaInformation);
    toolBar.add(btnMediaInformation);

    JButton btnCreateOflline = new JButton();
    btnCreateOflline.setAction(new MovieCreateOfflineAction(false));
    toolBar.add(btnCreateOflline);

    textField = EnhancedTextField.createSearchTextField();
    panelMovieList.add(textField, "3, 1, right, bottom");
    textField.setColumns(13);

    // table = new JTable();
    // build JTable

    MatcherEditor<Movie> textMatcherEditor = new TextComponentMatcherEditor<>(textField, new MovieFilterator());
    MovieMatcherEditor movieMatcherEditor = new MovieMatcherEditor();
    FilterList<Movie> extendedFilteredMovies = new FilterList<>(sortedMovies, movieMatcherEditor);
    textFilteredMovies = new FilterList<>(extendedFilteredMovies, textMatcherEditor);
    movieSelectionModel = new MovieSelectionModel(sortedMovies, textFilteredMovies, movieMatcherEditor);
    movieTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(textFilteredMovies),
            new MovieTableFormat());
    table = new ZebraJTable(movieTableModel);

    movieTableModel.addTableModelListener(new TableModelListener() {
        @Override
        public void tableChanged(TableModelEvent arg0) {
            lblMovieCountFiltered.setText(String.valueOf(movieTableModel.getRowCount()));
            // select first movie if nothing is selected
            ListSelectionModel selectionModel = table.getSelectionModel();
            if (selectionModel.isSelectionEmpty() && movieTableModel.getRowCount() > 0) {
                selectionModel.setSelectionInterval(0, 0);
            }
            if (selectionModel.isSelectionEmpty() && movieTableModel.getRowCount() == 0) {
                movieSelectionModel.setSelectedMovie(null);
            }
        }
    });

    // install and save the comparator on the Table
    movieSelectionModel.setTableComparatorChooser(
            TableComparatorChooser.install(table, sortedMovies, TableComparatorChooser.SINGLE_COLUMN));

    // table = new MyTable();
    table.setNewFontSize((float) ((int) Math.round(getFont().getSize() * 0.916)));
    // scrollPane.setViewportView(table);

    // JScrollPane scrollPane = new JScrollPane(table);
    JScrollPane scrollPane = ZebraJTable.createStripedJScrollPane(table);
    panelMovieList.add(scrollPane, "2, 3, 4, 1, fill, fill");

    {
        final JToggleButton filterButton = new JToggleButton(IconManager.FILTER);
        filterButton.setToolTipText(BUNDLE.getString("movieextendedsearch.options")); //$NON-NLS-1$
        panelMovieList.add(filterButton, "5, 1, right, bottom");

        // add a propertychangelistener which reacts on setting a filter
        movieSelectionModel.addPropertyChangeListener(new PropertyChangeListener() {
            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                if ("filterChanged".equals(evt.getPropertyName())) {
                    if (Boolean.TRUE.equals(evt.getNewValue())) {
                        filterButton.setIcon(IconManager.FILTER_ACTIVE);
                        filterButton.setToolTipText(BUNDLE.getString("movieextendedsearch.options.active")); //$NON-NLS-1$
                    } else {
                        filterButton.setIcon(IconManager.FILTER);
                        filterButton.setToolTipText(BUNDLE.getString("movieextendedsearch.options")); //$NON-NLS-1$
                    }
                }
            }
        });

        panelExtendedSearch = new MovieExtendedSearchPanel(movieSelectionModel);
        panelExtendedSearch.setVisible(false);
        // panelMovieList.add(panelExtendedSearch, "2, 5, 2, 1, fill, fill");
        filterButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                if (panelExtendedSearch.isVisible() == true) {
                    panelExtendedSearch.setVisible(false);
                } else {
                    panelExtendedSearch.setVisible(true);
                }
            }
        });
    }

    JPanel panelStatus = new JPanel();
    panelMovieList.add(panelStatus, "2, 6, 2, 1");
    panelStatus.setLayout(new FormLayout(
            new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("1px"),
                    ColumnSpec.decode("146px:grow"), FormFactory.RELATED_GAP_COLSPEC,
                    ColumnSpec.decode("default:grow"), },
            new RowSpec[] { RowSpec.decode("fill:default:grow"), }));

    panelMovieCount = new JPanel();
    panelStatus.add(panelMovieCount, "3, 1, left, fill");

    lblMovieCount = new JLabel(BUNDLE.getString("tmm.movies") + ":"); //$NON-NLS-1$
    panelMovieCount.add(lblMovieCount);

    lblMovieCountFiltered = new JLabel("");
    panelMovieCount.add(lblMovieCountFiltered);

    lblMovieCountOf = new JLabel(BUNDLE.getString("tmm.of")); //$NON-NLS-1$
    panelMovieCount.add(lblMovieCountOf);

    lblMovieCountTotal = new JLabel("");
    panelMovieCount.add(lblMovieCountTotal);

    JLayeredPane layeredPaneRight = new JLayeredPane();
    layeredPaneRight.setLayout(
            new FormLayout(new ColumnSpec[] { ColumnSpec.decode("default"), ColumnSpec.decode("default:grow") },
                    new RowSpec[] { RowSpec.decode("default"), RowSpec.decode("default:grow") }));
    panelRight = new MovieInformationPanel(movieSelectionModel);
    layeredPaneRight.add(panelRight, "1, 1, 2, 2, fill, fill");
    layeredPaneRight.setLayer(panelRight, 0);

    // glass pane
    layeredPaneRight.add(panelExtendedSearch, "1, 1, fill, fill");
    layeredPaneRight.setLayer(panelExtendedSearch, 1);

    splitPaneHorizontal.setRightComponent(layeredPaneRight);
    splitPaneHorizontal.setContinuousLayout(true);

    // beansbinding init
    initDataBindings();

    addComponentListener(new ComponentAdapter() {
        @Override
        public void componentHidden(ComponentEvent e) {
            menu.setVisible(false);
            super.componentHidden(e);
        }

        @Override
        public void componentShown(ComponentEvent e) {
            menu.setVisible(true);
            super.componentHidden(e);
        }
    });

    // further initializations
    init();

    // filter
    if (MovieModuleManager.MOVIE_SETTINGS.isStoreUiFilters()) {
        movieList.searchDuplicates();
        movieSelectionModel.filterMovies(MovieModuleManager.MOVIE_SETTINGS.getUiFilters());
    }
}