/** * Purpose: Creates the post-login GUI for browsing remote files and rendering them on screen * * @param remoteFiles a static list of files that are present on the server and can be retrieved * through the UI */ private void createBrowserUI(File[] remoteFiles) { // reset the main area this.removeAll(); JPanel mainPanel = new JPanel(new GridLayout(1, 1)); this.add(mainPanel); // split the main panel vertically JSplitPane vertSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); vertSplitPane.setDividerSize(1); vertSplitPane.setEnabled(false); mainPanel.add(vertSplitPane); // create header controls vertSplitPane.setLeftComponent(createFileSelectionHeader()); // split the lower content area horizontally JSplitPane hSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); browserController.setContentSplitter(hSplitPane); hSplitPane.setContinuousLayout(true); vertSplitPane.setRightComponent(hSplitPane); // add the file list to the left hand side JScrollPane fileListPane = createFileList(remoteFiles); hSplitPane.setLeftComponent(fileListPane); // initialize the browser control browserController.setSelectedFiles(null); this.revalidate(); this.repaint(); }
private JComponent createTabForSession(MemoryLogModel memoryLogModel) { ViewModel viewModel = new ViewModel(memoryLogModel); JComponent rawTable = createRawMessageTable(viewModel); JComponent crackedTable = createCrackedMessageTable(viewModel); JSplitPane messageView = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); messageView.setBorder(null); messageView.setLeftComponent(new JScrollPane(rawTable)); messageView.setRightComponent(new JScrollPane(crackedTable)); JSplitPane messageAndEventView = new JSplitPane(JSplitPane.VERTICAL_SPLIT); messageAndEventView.setResizeWeight(.66); messageAndEventView.setLeftComponent(messageView); messageAndEventView.setRightComponent(new JScrollPane(createEventMessageTable(viewModel))); messageAndEventView.setBorder(null); JPanel mainView = new JPanel(new BorderLayout()); mainView.add(messageAndEventView, BorderLayout.CENTER); // @todo - wrap the filter component in a "view builder". This will eliminate // the cast and provide the ability to change the layout without junking up // builder. JTextField filterField = new MessageSearchField(); FilterList<LogMessage> messages = ((GlazedListsMemoryLogModel) memoryLogModel).getMessages(); EventList matchers = new BasicEventList(); TextComponentMatcherEditor<LogMessage> liveSearchMatcherEditor = new TextComponentMatcherEditor<LogMessage>(filterField, new MessageFilterator()); matchers.add(liveSearchMatcherEditor); MatcherEditor matcherEditor = new CompositeMatcherEditor(matchers); messages.setMatcherEditor(matcherEditor); JPanel sortPanel = new JPanel(); ((FlowLayout) sortPanel.getLayout()).setAlignment(FlowLayout.LEFT); JCheckBox sortCheckbox = new JCheckBox("Keep New Messages At The Top"); sortPanel.add(sortCheckbox); sortCheckbox.addActionListener(viewModel.getSortByMessageIndexActionListener()); JCheckBox hideHeartbeats = new JCheckBox("Hide Heartbeats"); sortPanel.add(hideHeartbeats); hideHeartbeats.addActionListener(viewModel.getHideHeartbeatsActionListener()); JPanel filterPanel = new JPanel(); ((FlowLayout) filterPanel.getLayout()).setAlignment(FlowLayout.RIGHT); filterPanel.add(new JLabel("Search:")); filterPanel.add(filterField); JPanel northPanel = new JPanel(new BorderLayout()); northPanel.add(sortPanel, BorderLayout.WEST); northPanel.add(filterPanel, BorderLayout.EAST); mainView.add(northPanel, BorderLayout.NORTH); return mainView; }
public void createJPanel() { JSplitPane graphSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT); graphSplit.setLeftComponent(previewPanel); graphSplit.setRightComponent(dataPanel); graphSplit.setOneTouchExpandable(true); graphSplit.setDividerLocation(400); JPanel graphHolder = new JPanel(new BorderLayout()); graphHolder.add(graphSplit, BorderLayout.CENTER); graphHolder.setBorder(BorderFactory.createTitledBorder("")); JPanel tool = new JPanel(new BorderLayout()); tool.add(saveCSVData, BorderLayout.SOUTH); tool.add(aScanType, BorderLayout.CENTER); JPanel leftPanel = new JPanel(new BorderLayout()); leftPanel.add(graphHolder, BorderLayout.CENTER); leftPanel.add(tool, BorderLayout.SOUTH); JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); split.setOneTouchExpandable(true); split.setRightComponent(imageViewPanel); split.setLeftComponent(leftPanel); split.setDividerLocation(600); JPanel mainPanel = new JPanel(new BorderLayout()); mainPanel.add(split, BorderLayout.CENTER); getContentPane().setLayout(new BorderLayout()); getContentPane().add(mainPanel); aScanType.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { imageViewPanel.setViewType(aScanType.getSelectedIndex()); } }); saveCSVData.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { File f = FileSelectionField.getUserFile(); f = FileOperations.renameFileType(f, "csv"); saveAScanData(f); } catch (Exception e1) { JOptionPane.showMessageDialog( null, "Error : " + e1.getLocalizedMessage(), "Error Saving Data", JOptionPane.ERROR_MESSAGE); e1.printStackTrace(); } } }); }
/** Initializes the frame components. */ private void initialize() { GridBagConstraints c; // Set title, size and menus setDefaultCloseOperation(EXIT_ON_CLOSE); setTitle("Mibble MIB Browser"); Dimension size = Toolkit.getDefaultToolkit().getScreenSize(); Rectangle bounds = new Rectangle(); bounds.width = (int) (size.width * 0.75); bounds.height = (int) (size.height * 0.75); bounds.x = (size.width - bounds.width) / 2; bounds.y = (size.height - bounds.height) / 2; setBounds(bounds); setMenuBar(menuBar); initializeMenu(); getContentPane().setLayout(new GridBagLayout()); // Add horizontal split pane JSplitPane horizontalSplitPane = new JSplitPane(); horizontalSplitPane.setDividerLocation((int) (bounds.width * 0.35)); c = new GridBagConstraints(); c.weightx = 1.0d; c.weighty = 1.0d; c.fill = GridBagConstraints.BOTH; getContentPane().add(horizontalSplitPane, c); // Add status label c = new GridBagConstraints(); c.gridy = 1; c.fill = GridBagConstraints.BOTH; c.insets = new Insets(2, 5, 2, 5); getContentPane().add(statusLabel, c); // Add MIB tree mibTree = MibTreeBuilder.getInstance().getTree(); mibTree.addTreeSelectionListener( new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent e) { updateTreeSelection(); } }); horizontalSplitPane.setLeftComponent(new JScrollPane(mibTree)); // Add description area & SNMP panel JSplitPane verticalSplitPane = new JSplitPane(); verticalSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT); verticalSplitPane.setDividerLocation((int) (bounds.height * 0.40)); verticalSplitPane.setOneTouchExpandable(true); descriptionArea.setEditable(false); verticalSplitPane.setLeftComponent(new JScrollPane(descriptionArea)); snmpPanel = new SnmpPanel(this); verticalSplitPane.setRightComponent(snmpPanel); horizontalSplitPane.setRightComponent(verticalSplitPane); }
public PropertyBuilderGUI() { super(new BorderLayout()); JSplitPane sp1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); sp1.setLeftComponent(makeLeftPanel()); JSplitPane sp2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); sp2.setLeftComponent(makeCentrePanel()); sp2.setRightComponent(makeRightPanel()); sp2.setDividerLocation(550); sp1.setRightComponent(sp2); this.add(sp1, BorderLayout.CENTER); }
/** Create the GUI components and layout. */ private void init() { // called from ctor, so must not be overridable menuBar = new ReportMenuBar(); setJMenuBar(menuBar); JPanel all = new JPanel(new BorderLayout()); all.add(createToolBar(), BorderLayout.NORTH); JSplitPane treeAndMain = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); treePanel = createTreePanel(); treeAndMain.setLeftComponent(treePanel); mainPanel = createMainPanel(); treeAndMain.setRightComponent(mainPanel); treeAndMain.setResizeWeight(.2); treeAndMain.setContinuousLayout(true); all.add(treeAndMain, BorderLayout.CENTER); getContentPane().add(all); tree.setSelectionRow(1); addWindowListener(new WindowHappenings()); setTitle(DEFAULT_TITLE); setIconImage(JMeterUtils.getImage("jmeter.jpg").getImage()); // $NON-NLS-1$ }
private MyWindow(@Nonnull Class<?> testClass) { super(testClass); splitPane.setName("slideMeSplitPane"); splitPane.setLeftComponent(list("One", "Two")); splitPane.setRightComponent(list("Three")); addComponents(splitPane); }
public void initFenster() { // SplitPane JSplitPane splitPane = new JSplitPane(); getContentPane().add(splitPane, BorderLayout.CENTER); JScrollPane scrollPane = new JScrollPane(); splitPane.setLeftComponent(scrollPane); // Weinpanel weinpanel = new Weinpanel(this, betrieb); splitPane.setRightComponent(weinpanel); // Weinliste weinlist = new JList<Weine>(weinModel); weinlist.setFont(new Font("Tahoma", Font.PLAIN, 15)); weinlist.setBorder(new EmptyBorder(0, 0, 0, 100)); scrollPane.setViewportView(weinlist); weinlist.addListSelectionListener( new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent arg0) { doWeineValueChanged(arg0); } }); // Label Header JLabel lblHeader = new JLabel("alle Weine"); lblHeader.setFont(new Font("Tahoma", Font.BOLD, 15)); scrollPane.setColumnHeaderView(lblHeader); }
public FeedbackViewerUI( DefaultListModel<AbstractFeedbackType> questionListModel, DefaultListModel<FeedbackViewerUserEntry> userListModel) { super(); setTitle("Feedback Viewer"); setIconImage(Loader.getImageIcon(Loader.IMAGE_STURESY).getImage()); // Button Panel containing download/upload/etc. buttons JPanel buttonPanel = createButtonPanel(); JPanel leftPanel = new JPanel(); leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS)); questionList = new JList<>(questionListModel); questionList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); questionList.setCellRenderer(new NumberedListCellRenderer()); userList = new JList<>(userListModel); userList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); JScrollPane questionListScrollPane = new JScrollPane(questionList); JScrollPane userListScrollPane = new JScrollPane(userList); // Populate left panel of SplitPane leftPanel.add(new JLabel("Select by Question:")); leftPanel.add(questionListScrollPane); leftPanel.add(new JLabel("Select by User:")); leftPanel.add(userListScrollPane); splitPane = new JSplitPane(); splitPane.setLeftComponent(leftPanel); add(splitPane, BorderLayout.CENTER); add(buttonPanel, BorderLayout.PAGE_END); setRightPanel(new JPanel()); }
/** Default constructor */ BuildOutputViewerMainPanel() { super(new BorderLayout()); this.openedBuildOutputFrames = new LinkedHashMap<BuildOutput, JInternalFrame>(); JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); JSplitPanes.setDividerLocation(mainSplitPane, 0.2); JPanel overviewPanel = new JPanel(new BorderLayout()); JPanel overviewControlPanel = new JPanel(new GridLayout(0, 1)); overviewControlPanel.add(new JCheckBox(hideSkippedBuildsAction)); overviewControlPanel.add(new JCheckBox(hideBuildsWithoutMessagesAction)); overviewControlPanel.add(new JCheckBox(hideBuildsWithoutIncludesAction)); overviewPanel.add(overviewControlPanel, BorderLayout.NORTH); createProjectsTable(); overviewPanel.add(new JScrollPane(projectsTable), BorderLayout.CENTER); mainSplitPane.setLeftComponent(overviewPanel); desktopPane = new JDesktopPane(); mainSplitPane.setRightComponent(desktopPane); add(mainSplitPane, BorderLayout.CENTER); updateProjectsTableFilter(); }
public TriggerPanel(TriggersPackage pak, T trigger) { super(new BorderLayout()); this.pak = pak; this.trigger = trigger; this.tree_root = new DefaultMutableTreeNode(trigger.getName()); this.group_events = new TriggerEventRoot(); this.group_conditions = new TriggerConditionsRoot(); this.group_actions = new TriggerActionRoot(); this.tree_root.add(group_events); this.tree_root.add(group_conditions); this.tree_root.add(group_actions); this.tree_view = new TriggerTreeView(); this.comment.setText(trigger.comment); split.setTopComponent(split_h); split.setBottomComponent(south_h); JScrollPane left = new JScrollPane(tree_view); left.setMinimumSize(new Dimension(200, 120)); split_h.setLeftComponent(left); split_h.setRightComponent(new JScrollPane(comment)); split_h.setMinimumSize(new Dimension(200, 160)); tree_view.expandAll(); this.add(split); super.addAncestorListener(this); }
public CodeServerGui() { super("XApi Codeserver"); BorderLayout layout = new BorderLayout(5, 5); setLayout(layout); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 500, 300); // setAlwaysOnTop(true); test = new SingleFileSelector("Set Work Directory"); test.setToolTipText( "The working directory where gwt codeserver will write compiles. Defaults to " + tmpConfig.getParent()); test.setChooserType(JFileChooser.DIRECTORIES_ONLY); try { test.setFile(tmpConfig.getParentFile()); } catch (Exception e) { X_Log.warn(getClass(), "Error loading file ", tmpConfig.getParentFile(), e); } add(test, BorderLayout.NORTH); controls = new CodeServerControls( new Runnable() { @Override public void run() { launchServer(isUseTestSources(), "JS", getLogLevel()); } }); add(controls, BorderLayout.SOUTH); logger = new ProcessLog() { Runnable recalc; @Override public void invalidate() { super.invalidate(); if (null == recalc) { recalc = new Runnable() { @Override public void run() { recalc = null; CodeServerGui.this.validate(); } }; SwingUtilities.invokeLater(recalc); } } }; sources = new SourcesSelector("Gwt Sources", logger); JScrollPane wrap = new JScrollPane( logger, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); JSplitPane splitter = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); splitter.setLeftComponent(sources); splitter.setRightComponent(wrap); splitter.setResizeWeight(0.5); add(splitter, BorderLayout.CENTER); // add(logger,BorderLayout.EAST); }
public LogFilesTab() { _localFileSystem .getFileTree() .getSelectionModel() .addListSelectionListener(new LogSelectionListener(_localFileSystem.getFileTree())); this.setLayout(new GridBagLayout()); GridBagConstraints cons = new GridBagConstraints(); this.addComponentListener(this); _outerSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); _outerSplitPane.setLeftComponent(getLocalFileSystemPanel()); _outerSplitPane.setRightComponent(_middlePanel); cons.fill = GridBagConstraints.BOTH; cons.weightx = 1.0; cons.weighty = 1.0; // same weight for each size _outerSplitPane.setResizeWeight(0.5); this.add(_outerSplitPane, cons); // makes each side with same desired size so that the split happens exactly in the middle this.getLocalFileSystemPanel().setPreferredSize(_middlePanel.getPreferredSize()); }
public void initializeHelp() { try { // Create the nodes. DefaultMutableTreeNode top = new DefaultMutableTreeNode("INFORMATION MANAGEMENT SYSTEM HELP"); createNodes(top); // Create a tree that allows one selection at a time. tree = new JTree(top); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); // Listen for when the selection changes. tree.addTreeSelectionListener(this); if (playWithLineStyle) { System.out.println("line style = " + lineStyle); tree.putClientProperty("JTree.lineStyle", lineStyle); } // Create the scroll pane and add the tree to it. JScrollPane treeView = new JScrollPane(tree); // Create the HTML viewing pane. htmlPane = new JEditorPane(); htmlPane.setEditable(false); initHelp(); JScrollPane htmlView = new JScrollPane(htmlPane); splitPane.setLeftComponent(treeView); splitPane.setRightComponent(htmlView); } catch (Exception e) { e.printStackTrace(); } }
private JSplitPane buildSplitPane(Preferences preferences) { JSplitPane splitPane = new JSplitPane(); splitPane.setDoubleBuffered(true); splitPane.setLeftComponent(new JScrollPane(this.buildTree(preferences))); splitPane.setRightComponent(new JScrollPane(this.buildTable())); splitPane.setDividerLocation(150); return splitPane; }
public void load(String runtimeFileName, String userFileName) { getVM().loadFromImage(); createTreePanel(); splitPane.setLeftComponent(scrollTreePanel); }
public void setMainPane(Component comp) { if (splitpane != null) { splitpane.setLeftComponent(null); splitpane.setLeftComponent(comp); } }
private JSplitPane getSplitPane() { if (splitPane == null) { splitPane = new JSplitPane(); splitPane.setLeftComponent(getEditorContainer()); splitPane.setRightComponent(getLibraryPane()); splitPane.setResizeWeight(.6); } return splitPane; }
private Container panelPrincipal() { JSplitPane panelCentral = new JSplitPane(); panelCentral.setEnabled(true); panelCentral.setDividerLocation(500); panelCentral.setLeftComponent(panelIzquierdo()); panelCentral.setRightComponent(panelDerecho()); return panelCentral; }
public AppSubscriptionsPanel( final ClientDavConnection connection, final ClientApplication clientApplication, final DavApplication dav) { super(new BorderLayout()); _jSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); ApplicationSubscriptionInfo subscriptionInfo; try { subscriptionInfo = connection.getSubscriptionInfo(dav, clientApplication); } catch (IOException e) { subscriptionInfo = null; e.printStackTrace(); JOptionPane.showMessageDialog( this, "Konnte die Anmeldungen nicht auflisten. " + e.getMessage()); } final TitledBorder sendBorder = BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "Sende-Anmeldungen"); final TitledBorder receiveBorder = BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "Empfangs-Anmeldungen"); final TitledBorder labelBorder = BorderFactory.createTitledBorder("Details"); final JComponent paneSend = new JPanel(new BorderLayout()); _senderList = new JList( new MyListModel( subscriptionInfo == null ? Collections.emptyList() : subscriptionInfo.getSenderSubscriptions())); paneSend.add(new JScrollPane(_senderList), BorderLayout.CENTER); final JComponent paneReceive = new JPanel(new BorderLayout()); _receiverList = new JList( new MyListModel( subscriptionInfo == null ? Collections.emptyList() : subscriptionInfo.getReceiverSubscriptions())); paneReceive.add(new JScrollPane(_receiverList), BorderLayout.CENTER); paneSend.setBorder(sendBorder); paneReceive.setBorder(receiveBorder); _jSplitPane.setLeftComponent(paneSend); _jSplitPane.setRightComponent(paneReceive); _jSplitPane.setResizeWeight(0.5); _senderList.addMouseListener(new MyMouseListener(_senderList)); _receiverList.addMouseListener(new MyMouseListener(_receiverList)); _senderList.setFocusable(false); _receiverList.setFocusable(false); this.add(_jSplitPane, BorderLayout.CENTER); _label = new JEditorPane("text/html", ""); _label.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE); _label.setFont(_label.getFont().deriveFont(Font.PLAIN)); _label.setBorder(labelBorder); _label.setEditable(false); final JScrollPane pane = new JScrollPane(_label); pane.setBorder(BorderFactory.createEmptyBorder()); pane.setPreferredSize(new Dimension(400, 160)); this.add(pane, BorderLayout.SOUTH); }
private JSplitPane getJSplitPane() { if (jSplitPane == null) { jSplitPane = new JSplitPane(); jSplitPane.setName("jSplitPane"); jSplitPane.setRightComponent(getJScrollPaneDestra()); jSplitPane.setLeftComponent(getJPanel()); jSplitPane.setDividerLocation(100); } return jSplitPane; }
private void rearrange() { if (this.getComponent(0) != splitPane1) { this.removeAll(); this.add(splitPane2); } switch (currItems) { case 7: splitPane1.setLeftComponent(xmlView); splitPane1.setRightComponent( new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, textView, treeView)); splitPane2.setTopComponent(splitPane1); return; case 6: splitPane1.setLeftComponent(xmlView); splitPane1.setRightComponent(textView); splitPane2.setTopComponent(splitPane1); return; case 5: splitPane1.setLeftComponent(textView); splitPane1.setRightComponent(treeView); splitPane2.setTopComponent(splitPane1); return; case 4: this.removeAll(); splitPane2.setTopComponent(textView); this.add(splitPane2); return; case 3: splitPane1.setLeftComponent(xmlView); splitPane1.setRightComponent(treeView); return; case 2: this.removeAll(); splitPane2.setTopComponent(xmlView); this.add(splitPane2); return; case 1: this.removeAll(); splitPane2.setTopComponent(treeView); this.add(splitPane2); } }
public MainPanel(WorkbookFrame frame) { this.workbookManager = frame.getWorkbookManager(); workbookPanel = new WorkbookPanel(workbookManager); setLayout(new BorderLayout()); JSplitPane sp = new JSplitPane(); sp.setLeftComponent(workbookPanel); ValidationInspectorPanel validationInspectorPanel = new ValidationInspectorPanel(frame); sp.setRightComponent(validationInspectorPanel); sp.setResizeWeight(0.9); add(sp); }
void show() { if (isShowing) return; tablePanel.remove(currentComponent); split.setLeftComponent(currentComponent); split.setDividerLocation(splitPos); currentComponent = split; tablePanel.add(currentComponent, BorderLayout.CENTER); tablePanel.revalidate(); isShowing = true; }
/** * This method initializes splitPanePrincipal * * @return javax.swing.JSplitPane */ private JSplitPane getSplitPanePrincipal() { if (splitPanePrincipal == null) { splitPanePrincipal = new JSplitPane(); splitPanePrincipal.setContinuousLayout(true); splitPanePrincipal.setDividerLocation(150); splitPanePrincipal.setOneTouchExpandable(true); splitPanePrincipal.setRightComponent(getSplitPane()); splitPanePrincipal.setLeftComponent(getPanelJogadores()); } return splitPanePrincipal; }
private void build() { buildRightPanel(); buildLeftPanel(); splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); splitPane.setLeftComponent(leftPanel); splitPane.setRightComponent(rightPanel); setLayout(new BorderLayout()); add(splitPane); splitPane.setDividerLocation(0.25d); initMenu(); }
private void initSplitPanes() { createViews(); verticalSplit = createSplitPane(JSplitPane.VERTICAL_SPLIT); verticalSplit.setTopComponent(packageView); verticalSplit.setBottomComponent(descView); horizontalSplit = createSplitPane(JSplitPane.HORIZONTAL_SPLIT); horizontalSplit.setRightComponent(verticalSplit); horizontalSplit.setLeftComponent(optionsView); postInit(); }
/** * Reset import screen. This can be used while creating totally new instance of import screen or * just resetting the default. * * @param setVisibleAfterReset set import screen frame visible after it has been reseted */ public void resetImportScreen(boolean setVisibleAfterReset) { application = Session.getSession().getApplication(); // If frame exists, set visibility to false while resetting if (frame != null) { frame.setVisible(false); } // Create new instances of conversion model, column type manager and trimmers conversionModel = new ConversionModel(this); columnTypeManager = new ColumnTypeManager(0); dataTrimmer = new DataTrimmer(); // Ignore first dataTrimmer.addIgnoreColumnNumber(0); flagTrimmer = new DataTrimmer(); flagTrimmer.addIgnoreColumnNumber(0); // Table has to be first to get references right tableFrame = new TableInternalFrame(this); toolsFrame = new ToolsInternalFrame(this); conversionModel.addConversionChangeListener(tableFrame); columnTypeManager.addColumnTypeChangeListener(tableFrame); columnTypeManager.addColumnTypeChangeListener(toolsFrame); frame = new JFrame("Import tool"); mainSplit = new JSplitPane(); frame.setLayout(new BorderLayout()); frame.setSize(IMPORT_SCREEN_SIZE); mainSplit.setOrientation(JSplitPane.HORIZONTAL_SPLIT); mainSplit.setDividerLocation(TOOLS_FRAME_WIDTH); mainSplit.setLeftComponent(toolsFrame); mainSplit.setRightComponent(tableFrame); mainSplit.getLeftComponent().setMinimumSize(new Dimension(150, 0)); mainSplit.setResizeWeight(0); frame.add(mainSplit, BorderLayout.CENTER); // Reset buttons changeStepPanel = null; frame.add(getChangeStepButtonsPanel(), BorderLayout.SOUTH); if (setVisibleAfterReset) { frame.setVisible(true); } }
/** * Creates a new JSplitPane object with the given orientation, layout mode, and left and right * components. * * @param newOrientation The orientation to use. * @param newContinuousLayout The layout mode to use. * @param newLeftComponent The left component. * @param newRightComponent The right component. * @throws IllegalArgumentException DOCUMENT ME! */ public JSplitPane( int newOrientation, boolean newContinuousLayout, Component newLeftComponent, Component newRightComponent) { if (newOrientation != HORIZONTAL_SPLIT && newOrientation != VERTICAL_SPLIT) throw new IllegalArgumentException("orientation is invalid."); orientation = newOrientation; continuousLayout = newContinuousLayout; setLeftComponent(newLeftComponent); setRightComponent(newRightComponent); updateUI(); }
/** * Create all the components of the panel: JSplitPane with a scroll pane with the tree on the left * side and a holder JPanel for properties on the right. */ private void setupFrame() { splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); splitPane.setResizeWeight(0); // Setup right panel holder JPanel holderPropertiesPanel = new JPanel(new MigLayout("insets 0")); splitPane.setRightComponent(holderPropertiesPanel); // Setup left panel with tree and it's selection behavior tree = buildAndSetupTree(); JScrollPane treePane = new JScrollPane(tree); splitPane.setLeftComponent(treePane); splitPane.setDividerLocation(200); add(splitPane, "w 100%, h 100%"); // revalidate(); }