Java Code Examples for javax.swing.JSplitPane#setDividerLocation()

The following examples show how to use javax.swing.JSplitPane#setDividerLocation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Viewer.java    From accumulo-examples with Apache License 2.0 6 votes vote down vote up
public void init() throws TableNotFoundException {
  DefaultMutableTreeNode root = new DefaultMutableTreeNode(
      new NodeInfo(topPath, q.getData(topPath)));
  populate(root);
  populateChildren(root);

  treeModel = new DefaultTreeModel(root);
  tree = new JTree(treeModel);
  tree.addTreeExpansionListener(this);
  tree.addTreeSelectionListener(this);
  text = new JTextArea(getText(q.getData(topPath)));
  data = new JTextArea("");
  JScrollPane treePane = new JScrollPane(tree);
  JScrollPane textPane = new JScrollPane(text);
  dataPane = new JScrollPane(data);
  JSplitPane infoSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, textPane, dataPane);
  JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, treePane, infoSplitPane);
  mainSplitPane.setDividerLocation(300);
  infoSplitPane.setDividerLocation(150);
  getContentPane().add(mainSplitPane, BorderLayout.CENTER);
}
 
Example 2
Source File: OurUtil.java    From org.alloytools.alloy with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs a new SplitPane containing the two components given as arguments
 *
 * @param orientation - the orientation (HORIZONTAL_SPLIT or VERTICAL_SPLIT)
 * @param first - the left component (if horizontal) or top component (if
 *            vertical)
 * @param second - the right component (if horizontal) or bottom component (if
 *            vertical)
 * @param initialDividerLocation - the initial divider location (in pixels)
 */
public static JSplitPane splitpane(int orientation, Component first, Component second, int initialDividerLocation) {
    JSplitPane x = make(new JSplitPane(orientation, first, second), new EmptyBorder(0, 0, 0, 0));
    x.setContinuousLayout(true);
    x.setDividerLocation(initialDividerLocation);
    x.setOneTouchExpandable(false);
    x.setResizeWeight(0.5);
    if (Util.onMac() && (x.getUI() instanceof BasicSplitPaneUI)) {
        boolean h = (orientation != JSplitPane.HORIZONTAL_SPLIT);
        ((BasicSplitPaneUI) (x.getUI())).getDivider().setBorder(new OurBorder(h, h, h, h)); // Makes
                                                                                           // the
                                                                                           // border
                                                                                           // look
                                                                                           // nicer
                                                                                           // on
                                                                                           // Mac
                                                                                           // OS
                                                                                           // X
    }
    return x;
}
 
Example 3
Source File: BBoxDBGui.java    From bboxdb with Apache License 2.0 5 votes vote down vote up
/**
 * Initialize the GUI panel
 * @return 
 */
private JSplitPane buildSplitPane() {
	final JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
	splitPane.setLeftComponent(getLeftPanel());
	splitPane.setOneTouchExpandable(true);
	splitPane.setDividerLocation(150);
	
	return splitPane;
}
 
Example 4
Source File: ChatPanel.java    From xyTalk-pc with GNU Affero General Public License v3.0 5 votes vote down vote up
private void initView() {
	this.setLayout(new GridLayout(1, 1));

	if (roomId == null) {
		messagePanel.setVisible(false);
		messageEditorPanel.setVisible(false);
		DebugUtil.debug("roomId == null");
	}

	splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true);
	// splitPane.setBorder(new RCBorder(RCBorder.BOTTOM,
	// Colors.LIGHT_GRAY));
	splitPane.setBorder(null);
	// splitPane.setUI(new BasicSplitPaneUI());
	// BasicSplitPaneDivider divider = (BasicSplitPaneDivider)
	// splitPane.getComponent(0);
	// divider.setBackground(Colors.FONT_BLACK);
	// divider.setBorder(null);
	splitPane.setOneTouchExpandable(false);
	splitPane.setDividerLocation(450);
	// splitPane.setResizeWeight(0.1);
	splitPane.setDividerSize(2);

	splitPane.setTopComponent(messagePanel);
	splitPane.setBottomComponent(messageEditorPanel);
	splitPane.setPreferredSize(new Dimension(MainFrame.DEFAULT_WIDTH, MainFrame.DEFAULT_HEIGHT));
	// add(splitPane, new GBC(0, 0).setFill(GBC.BOTH).setWeight(1, 4));
	// add(splitPane, new GBC(0, 0).setFill(GBC.BOTH).setWeight(1, 10));
	add(splitPane);
	// add(messagePanel, new GBC(0, 0).setFill(GBC.BOTH).setWeight(1, 4));
	// add(messageEditorPanel, new GBC(0, 1).setFill(GBC.BOTH).setWeight(1,
	// 1));

}
 
Example 5
Source File: ConfigWorkspace.java    From Thunder with Apache License 2.0 5 votes vote down vote up
public ConfigWorkspace() {
    super();

    container = new JPanel();
    container.setLayout(new BorderLayout());

    blankPane = new JPanel();
    container.add(blankPane, BorderLayout.CENTER);

    JSplitPane splitPane = new JSplitPane();
    splitPane.setLeftComponent(new JBasicScrollPane(createConfigTree()));
    splitPane.setRightComponent(container);
    splitPane.setDividerLocation(200);

    double[][] size = {
            { TableLayout.FILL },
            { TableLayout.FILL, TableLayout.PREFERRED }
    };

    TableLayout tableLayout = new TableLayout(size);
    tableLayout.setHGap(0);
    tableLayout.setVGap(5);

    setLayout(tableLayout);
    add(splitPane, "0, 0");
    add(createButtonSpace(), "0, 1");
}
 
Example 6
Source File: Test6910490.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void init() {
    Insets insets = new Insets(10, 10, 10, 10);
    Dimension size = new Dimension(getWidth() / 2, getHeight());
    JSplitPane pane = new JSplitPane(
            JSplitPane.HORIZONTAL_SPLIT,
            create("Color", size, new MatteBorder(insets, RED)),
            create("Icon", size, new MatteBorder(insets, this)));
    pane.setDividerLocation(size.width - pane.getDividerSize() / 2);
    add(pane);
}
 
Example 7
Source File: FFTPanel.java    From DeconvolutionLab2 with GNU General Public License v3.0 5 votes vote down vote up
public FFTPanel(int w, int h) {
	super(new BorderLayout());
	ArrayList<CustomizedColumn> columns = new ArrayList<CustomizedColumn>();
	columns.add(new CustomizedColumn("Name", String.class, 120, false));
	columns.add(new CustomizedColumn("Installed", String.class, 120, false));
	columns.add(new CustomizedColumn("Multithreadable", String.class, 120, false));
	columns.add(new CustomizedColumn("Location", String.class, Constants.widthGUI, false));
	table = new CustomizedTable(columns, true);
	table.setRowSelectionAllowed(true);
	table.addMouseListener(this);
	libs = FFT.getRegisteredLibraries();
	for (AbstractFFTLibrary lib : libs) {
		String name = lib.getLibraryName();
		String installed = lib.isInstalled() ? "Yes" : "No";
		String multit = lib.getDefaultFFT().isMultithreadable() ? "Yes" : "No";
		String location = lib.getLocation();
		table.append(new String[] { name, installed, multit, location });
	}
	info = new HTMLPane(w, h-100);
	
	JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT, table.getPane(w, 100), info.getPane());
	split.setDividerLocation(0.5);
	add(split, BorderLayout.CENTER);
	table.setRowSelectionInterval(0, 0);
	info.clear();
	info.append("p", libs.get(0).getLicence());
}
 
Example 8
Source File: EditUsersDialog.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
public EditUsersDialog(JFrame frame, UserFactory userFactory,
                       AdminPanelPlugin plugin, Engine engine) {
    super(frame, true);
    this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    this.factory = userFactory;
    this.plugin = plugin;

    this.setTitle(plugin.getString("Action.EditUsers"));

    users = factory.getUsers();
    groups = factory.getGroups();
    qualifiers = engine.getQualifiers();

    createModels();

    createActions();

    JComponent userPanel = createUserPanel();
    JComponent groupPanel = createGroupPanel();

    JSplitPane pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    pane.setLeftComponent(userPanel);
    pane.setRightComponent(groupPanel);
    JToolBar panel = new JToolBar();
    panel.add(createUser).setFocusable(false);
    panel.add(editUser).setFocusable(false);
    panel.add(deleteUser).setFocusable(false);
    panel.add(createGroup).setFocusable(false);
    panel.add(deleteGroup).setFocusable(false);

    JPanel panel2 = new JPanel(new BorderLayout());
    panel2.add(panel, BorderLayout.NORTH);
    panel2.add(pane, BorderLayout.CENTER);
    pane.setDividerLocation(300);
    setMainPane(panel2);
    this.setMinimumSize(new Dimension(800, 600));
    this.setLocationRelativeTo(null);
    Options.loadOptions(this);
}
 
Example 9
Source File: GUIBrowser.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private JSplitPane createUnderPane(JTree tree) {
    JTextArea toStringArea = new JTextArea();
    toStringArea.setLineWrap(true);
    toStringArea.setEditable(false);
    tree.addTreeSelectionListener(new ToStringListener(toStringArea));
    JSplitPane result = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
            new JScrollPane(tree),
            new JScrollPane(toStringArea));
    result.setOneTouchExpandable(true);
    result.setDividerSize(8);
    result.setDividerLocation(0.8);
    return result;
}
 
Example 10
Source File: Test6910490.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void init() {
    Insets insets = new Insets(10, 10, 10, 10);
    Dimension size = new Dimension(getWidth() / 2, getHeight());
    JSplitPane pane = new JSplitPane(
            JSplitPane.HORIZONTAL_SPLIT,
            create("Color", size, new MatteBorder(insets, RED)),
            create("Icon", size, new MatteBorder(insets, this)));
    pane.setDividerLocation(size.width - pane.getDividerSize() / 2);
    add(pane);
}
 
Example 11
Source File: CommitsPanelProvider.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
private JPanel initLowerPanel() {
  JPanel panel = new JPanel(new GridLayout(1, 1));
  panel.setOpaque(false);
  panel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));

  JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, initFilesPanel(), initSegmentsPanel());
  splitPane.setOpaque(false);
  splitPane.setBorder(BorderFactory.createEmptyBorder());
  splitPane.setDividerLocation(300);
  panel.add(splitPane);
  return panel;
}
 
Example 12
Source File: CommitsPanelProvider.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
public JPanel get() {
  JPanel panel = new JPanel(new GridLayout(1, 1));
  panel.setOpaque(false);
  panel.setBorder(BorderFactory.createLineBorder(Color.gray));

  JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, initUpperPanel(), initLowerPanel());
  splitPane.setOpaque(false);
  splitPane.setBorder(BorderFactory.createEmptyBorder());
  splitPane.setDividerLocation(120);
  panel.add(splitPane);

  return panel;
}
 
Example 13
Source File: AnalysisPanelProvider.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
public JPanel get() {
  JPanel panel = new JPanel(new GridLayout(1, 1));
  panel.setOpaque(false);
  panel.setBorder(BorderFactory.createLineBorder(Color.gray));

  JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, initUpperPanel(), initLowerPanel());
  splitPane.setOpaque(false);
  splitPane.setDividerLocation(320);
  panel.add(splitPane);

  return panel;
}
 
Example 14
Source File: SourceTab.java    From FoxTelem with GNU General Public License v3.0 4 votes vote down vote up
private void buildBottomPanel(JPanel parent, String layout, JPanel bottomPanel) {
		//parent.add(bottomPanel, layout);
		////bottomPanel.setLayout(new BoxLayout(bottomPanel, BoxLayout.X_AXIS));
		bottomPanel.setLayout(new BorderLayout(3, 3));
		bottomPanel.setPreferredSize(new Dimension(800, 250));
		/*
		JPanel audioOpts = new JPanel();
		bottomPanel.add(audioOpts, BorderLayout.NORTH);

		rdbtnShowFFT = new JCheckBox("Show FFT");
		rdbtnShowFFT.addItemListener(this);
		rdbtnShowFFT.setSelected(true);
		audioOpts.add(rdbtnShowFFT);
		*/
		
		audioGraph = new AudioGraphPanel();
		audioGraph.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
		bottomPanel.add(audioGraph, BorderLayout.CENTER);
		audioGraph.setBackground(Color.LIGHT_GRAY);
		//audioGraph.setPreferredSize(new Dimension(800, 250));
		
		if (audioGraphThread != null) { audioGraph.stopProcessing(); }		
		audioGraphThread = new Thread(audioGraph);
		audioGraphThread.setUncaughtExceptionHandler(Log.uncaughtExHandler);
		audioGraphThread.start();

		JPanel eyePhasorPanel = new JPanel();
		eyePhasorPanel.setLayout(new BorderLayout());
		
		eyePanel = new EyePanel();
		eyePanel.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
		bottomPanel.add(eyePhasorPanel, BorderLayout.EAST);
		eyePhasorPanel.add(eyePanel, BorderLayout.WEST);
		eyePanel.setBackground(Color.LIGHT_GRAY);
		eyePanel.setPreferredSize(new Dimension(200, 100));
		eyePanel.setMaximumSize(new Dimension(200, 100));
		eyePanel.setVisible(true);
		
		phasorPanel = new PhasorPanel();
		phasorPanel.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
		eyePhasorPanel.add(phasorPanel, BorderLayout.EAST);
		phasorPanel.setBackground(Color.LIGHT_GRAY);
		phasorPanel.setPreferredSize(new Dimension(200, 100));
		phasorPanel.setMaximumSize(new Dimension(200, 100));
		phasorPanel.setVisible(false);
		
		fftPanel = new FFTPanel();
		fftPanel.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
		fftPanel.setBackground(Color.LIGHT_GRAY);
		
		//bottomPanel.add(fftPanel, BorderLayout.SOUTH);
		showFFT(false);
		fftPanel.setPreferredSize(new Dimension(100, 150));
		fftPanel.setMaximumSize(new Dimension(100, 150));
		
		splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
				bottomPanel, fftPanel);
		splitPane.setOneTouchExpandable(true);
		splitPane.setContinuousLayout(true); // repaint as we resize, otherwise we can not see the moved line against the dark background
		if (Config.splitPaneHeight != 0) 
			splitPane.setDividerLocation(Config.splitPaneHeight);
		else
			splitPane.setDividerLocation(200);
		SplitPaneUI spui = splitPane.getUI();
	    if (spui instanceof BasicSplitPaneUI) {
	      // Setting a mouse listener directly on split pane does not work, because no events are being received.
	      ((BasicSplitPaneUI) spui).getDivider().addMouseListener(new MouseAdapter() {
	          public void mouseReleased(MouseEvent e) {
	        	  if (Config.iq == true) {
	        		  splitPaneHeight = splitPane.getDividerLocation();
	        		  //Log.println("SplitPane: " + splitPaneHeight);
	        		  Config.splitPaneHeight = splitPaneHeight;
	        	  }
	          }
	      });
	    }
;
		
		parent.add(splitPane, layout);
		
	}
 
Example 15
Source File: ProjectFilePanel.java    From mpxj with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * Constructor.
 *
 * @param file MPP file to be displayed in this view.
 */
public ProjectFilePanel(File file)
{
   m_treeModel = new ProjectTreeModel();
   m_treeController = new ProjectTreeController(m_treeModel);
   setLayout(new GridLayout(0, 1, 0, 0));
   m_treeView = new ProjectTreeView(m_treeModel);
   m_treeView.setShowsRootHandles(true);

   JSplitPane splitPane = new JSplitPane();
   splitPane.setDividerLocation(0.3);
   add(splitPane);

   JScrollPane scrollPane = new JScrollPane(m_treeView);
   splitPane.setLeftComponent(scrollPane);

   final JTabbedPane tabbedPane = new JTabbedPane(SwingConstants.TOP);
   splitPane.setRightComponent(tabbedPane);

   m_openTabs = new HashMap<>();

   m_treeView.addTreeSelectionListener(new TreeSelectionListener()
   {
      @Override public void valueChanged(TreeSelectionEvent e)
      {
         TreePath path = e.getPath();
         MpxjTreeNode component = (MpxjTreeNode) path.getLastPathComponent();
         if (!(component.getUserObject() instanceof String))
         {
            ObjectPropertiesPanel panel = m_openTabs.get(component);
            if (panel == null)
            {
               panel = new ObjectPropertiesPanel(component.getUserObject(), component.getExcludedMethods());
               tabbedPane.add(component.toString(), panel);
               m_openTabs.put(component, panel);
            }
            tabbedPane.setSelectedComponent(panel);
         }
      }
   });

   m_treeController.loadFile(file);
}
 
Example 16
Source File: EdgeSim.java    From EdgeSim with MIT License 4 votes vote down vote up
/**
 * Add a controller to the emulator and initialize the main window. In
 * addition, the main window adds listeners.
 */
private void initial() {
	{
		// Instantiate all components and controller
		Controller controller = new Controller();
		this.map = new Map();
		this.operator = new Operator();
		this.log = new Log();
		this.menu = new MenuBar();
		controller.initialController(menu, map, operator, log, controller);
	}

	{
		// Initialize UI
		JPanel panel = new JPanel();
		GridBagLayout variablePanel = new GridBagLayout();
		variablePanel.columnWidths = new int[] { 0, 0 };
		variablePanel.rowHeights = new int[] { 0, 0, 0 };
		variablePanel.columnWeights = new double[] { 0.0, Double.MIN_VALUE };
		variablePanel.rowWeights = new double[] { 1.0, 0.0,
				Double.MIN_VALUE };
		panel.setLayout(variablePanel);

		// Initialize main frame
		mainFrame = new JFrame();
		mainFrame.setTitle("EdgeSim");
		mainFrame.setBounds(250, 0, 1400, 1050);
		
		mainFrame.setExtendedState(Frame.MAXIMIZED_BOTH);

		
		// mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH); .
		mainFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		ImageIcon icon = new ImageIcon("src/main/resources/images/icon.png"); // xxx����ͼƬ���·����2.pngͼƬ���Ƽ���ʽ
		mainFrame.setIconImage(icon.getImage());

		// Add menu
		mainFrame.getContentPane().add(menu, BorderLayout.NORTH);

		// Set the separation panel
		JSplitPane MainPanel = new JSplitPane();
		MainPanel.setContinuousLayout(true);
		MainPanel.setResizeWeight(1);
		MainPanel.setDividerLocation(0.9);
		mainFrame.getContentPane().add(MainPanel, BorderLayout.CENTER);

		JSplitPane MapAndLogPanel = new JSplitPane(
				JSplitPane.VERTICAL_SPLIT);
		MapAndLogPanel.setContinuousLayout(true);
		MapAndLogPanel.setResizeWeight(0.8);
		MainPanel.setDividerLocation(0.9);

		MapAndLogPanel.setLeftComponent(map);
		MapAndLogPanel.setRightComponent(log);

		MainPanel.setLeftComponent(MapAndLogPanel);
		MainPanel.setRightComponent(operator);

	}

	// Add listener
	mainFrame.addWindowListener(new MyActionListener());
}
 
Example 17
Source File: MultiSpectraVisualizerWindow.java    From mzmine2 with GNU General Public License v2.0 4 votes vote down vote up
private JPanel addSpectra(int scan) {
  JPanel panel = new JPanel(new BorderLayout());
  // Split pane for eic plot (top) and spectrum (bottom)
  JSplitPane bottomPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);

  // Create EIC plot
  // labels for TIC visualizer
  Map<Feature, String> labelsMap = new HashMap<Feature, String>(0);

  Feature peak = row.getPeak(activeRaw);

  // scan selection
  ScanSelection scanSelection = new ScanSelection(activeRaw.getDataRTRange(1), 1);

  // mz range
  Range<Double> mzRange = null;
  mzRange = peak.getRawDataPointsMZRange();
  // optimize output by extending the range
  double upper = mzRange.upperEndpoint();
  double lower = mzRange.lowerEndpoint();
  double fiveppm = (upper * 5E-6);
  mzRange = Range.closed(lower - fiveppm, upper + fiveppm);

  // labels
  labelsMap.put(peak, peak.toString());

  // get EIC window
  TICVisualizerWindow window = new TICVisualizerWindow(new RawDataFile[] {activeRaw}, // raw
      TICPlotType.BASEPEAK, // plot type
      scanSelection, // scan selection
      mzRange, // mz range
      new Feature[] {peak}, // selected features
      labelsMap); // labels

  // get EIC Plot
  TICPlot ticPlot = window.getTICPlot();
  ticPlot.setPreferredSize(new Dimension(600, 200));
  ticPlot.getChart().getLegend().setVisible(false);

  // add a retention time Marker to the EIC
  ValueMarker marker = new ValueMarker(activeRaw.getScan(scan).getRetentionTime());
  marker.setPaint(Color.RED);
  marker.setStroke(new BasicStroke(3.0f));

  XYPlot plot = (XYPlot) ticPlot.getChart().getPlot();
  plot.addDomainMarker(marker);
  bottomPane.add(ticPlot);
  bottomPane.setResizeWeight(0.5);
  bottomPane.setEnabled(true);
  bottomPane.setDividerSize(5);
  bottomPane.setDividerLocation(200);

  JSplitPane spectrumPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);

  // get MS/MS spectra window
  SpectraVisualizerWindow spectraWindow = new SpectraVisualizerWindow(activeRaw);
  spectraWindow.loadRawData(activeRaw.getScan(scan));

  // get MS/MS spectra plot
  SpectraPlot spectrumPlot = spectraWindow.getSpectrumPlot();
  spectrumPlot.getChart().getLegend().setVisible(false);
  spectrumPlot.setPreferredSize(new Dimension(600, 400));
  spectrumPane.add(spectrumPlot);
  spectrumPane.add(spectraWindow.getToolBar());
  spectrumPane.setResizeWeight(1);
  spectrumPane.setEnabled(false);
  spectrumPane.setDividerSize(0);
  bottomPane.add(spectrumPane);
  panel.add(bottomPane);
  panel.setBorder(BorderFactory.createLineBorder(Color.black));
  return panel;
}
 
Example 18
Source File: ToolExecutionForm.java    From snap-desktop with GNU General Public License v3.0 4 votes vote down vote up
public ToolExecutionForm(AppContext appContext, ToolAdapterOperatorDescriptor descriptor, PropertySet propertySet,
                         TargetProductSelector targetProductSelector) {
    this.appContext = appContext;
    this.operatorDescriptor = descriptor;
    this.propertySet = propertySet;
    this.targetProductSelector = targetProductSelector;

    //before executing, the sourceProduct and sourceProductFile must be removed from the list, since they cannot be edited
    Property sourceProperty = this.propertySet.getProperty(ToolAdapterConstants.TOOL_SOURCE_PRODUCT_FILE);
    if(sourceProperty != null) {
        this.propertySet.removeProperty(sourceProperty);
    }
    sourceProperty = this.propertySet.getProperty(ToolAdapterConstants.TOOL_SOURCE_PRODUCT_ID);
    if(sourceProperty != null) {
        this.propertySet.removeProperty(sourceProperty);
    }
    // if the tool is handling by itself the output product name, then remove targetProductFile from the list,
    // since it may bring only confusion in this case
    if (operatorDescriptor.isHandlingOutputName()) {
        sourceProperty = this.propertySet.getProperty(ToolAdapterConstants.TOOL_TARGET_PRODUCT_FILE);
        if (sourceProperty != null) {
            this.propertySet.removeProperty(sourceProperty);
        }
    }

    //initialise the target product's directory to the working directory
    final TargetProductSelectorModel targetProductSelectorModel = targetProductSelector.getModel();
    targetProductSelectorModel.setProductDir(operatorDescriptor.resolveVariables(operatorDescriptor.getWorkingDir()));

    if(!operatorDescriptor.isHandlingOutputName() || operatorDescriptor.getSourceProductCount() > 0) {
        ioParamPanel = createIOParamTab();
        addTab("I/O Parameters", ioParamPanel);
    }
    JPanel processingParamPanel = new JPanel(new SpringLayout());
    checkDisplayOutput = new JCheckBox("Display execution output");
    checkDisplayOutput.setSelected(Boolean.parseBoolean(NbPreferences.forModule(Dialogs.class).get(ToolAdapterOptionsController.PREFERENCE_KEY_SHOW_EXECUTION_OUTPUT, "false")));
    processingParamPanel.add(checkDisplayOutput);
    bottomPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    bottomPane.setTopComponent(createProcessingParamTab());
    console = new ConsolePane();
    if (checkDisplayOutput.isSelected()) {
        bottomPane.setBottomComponent(console);
        bottomPane.setDividerLocation(0.6);
    }
    processingParamPanel.add(bottomPane);
    checkDisplayOutput.addActionListener((ActionEvent e) -> {
        if (!checkDisplayOutput.isSelected()) {
            bottomPane.remove(console);
        } else {
            bottomPane.setBottomComponent(console);
        }
        refreshDimension();
    });
    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
    setPreferredSize(new Dimension((int)(screen.getWidth() / 3), (int)(screen.getHeight() / 2.5)));
    setMinimumSize(new Dimension(200, 200));
    SpringUtilities.makeCompactGrid(processingParamPanel, 2, 1, 2, 2, 2, 2);
    addTab("Processing Parameters", processingParamPanel);
    updateTargetProductFields();
}
 
Example 19
Source File: SearchPanelProvider.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
private JSplitPane initUpperPanel() {
  JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, initQuerySettingsPane(), initQueryPane());
  splitPane.setOpaque(false);
  splitPane.setDividerLocation(570);
  return splitPane;
}
 
Example 20
Source File: Scatterplot3D.java    From chipster with MIT License 4 votes vote down vote up
@Override
public JComponent getVisualisation(DataBean data) throws Exception {

	this.data = data;

	refreshAxisBoxes(data);

	List<Variable> vars = getFrame().getVariables();
	if (vars == null || vars.size() < 4) {
		if (xBox.getItemCount() >= 1) {
			xBox.setSelectedIndex(0);
		}
		if (yBox.getItemCount() >= 2) {
			yBox.setSelectedIndex(1);
		}
		if (zBox.getItemCount() >= 3) {
			zBox.setSelectedIndex(2);
		}

		if (colorBox.getItemCount() >= 4) {
			colorBox.setSelectedIndex(3);
		}
	} else {
		xBox.setSelectedItem(vars.get(0));
		yBox.setSelectedItem(vars.get(1));
		zBox.setSelectedItem(vars.get(2));
		colorBox.setSelectedItem(vars.get(3));
	}

	List<Variable> variables = new LinkedList<Variable>();
	variables.add((Variable) xBox.getSelectedItem());
	variables.add((Variable) yBox.getSelectedItem());
	variables.add((Variable) zBox.getSelectedItem());
	variables.add((Variable) colorBox.getSelectedItem());

	if (variables.size() >= 4 && variables.get(0) != null && variables.get(1) != null && variables.get(2) != null && variables.get(3) != null) {

		retrieveData(variables);
		

		JPanel panel = new JPanel();
		panel.setLayout(new BorderLayout());

		coordinateArea = new CoordinateArea(this);
		coordinateArea.addKeyListener(this);
		coordinateArea.requestFocus();
		
		if (getDataModel().getDataArray().length > DEFAULT_TO_DOT_PAINT_MODE) {
			paintModeBox.setSelectedItem(PaintMode.RECT);
		}

		JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
		split.setDividerSize(3);
		split.setOpaque(true);
		split.setRightComponent(coordinateArea);
		scalePanel = null;
		split.setLeftComponent(getColorScalePanel());
		split.setContinuousLayout(true);
		split.setDividerLocation(150);

		panel.add(split, BorderLayout.CENTER);

		coordinateArea.setCursor(ROTATE_CURSOR);
		this.setToolsEnabled(true);
		
		updateBackgroundColor();

		return panel;
	}
	return this.getDefaultVisualisation();
}