bibliothek.gui.dock.common.CGrid Java Examples

The following examples show how to use bibliothek.gui.dock.common.CGrid. 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: DockingFrame.java    From Rails with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Decision whether docking framework should be activated for a frame
 * has to be done at the beginning as later switching is not supported
 */
protected DockingFrame(boolean isDockingFrameworkEnabled, SplashWindow splashWindow) {

    this.isDockingFrameworkEnabled = isDockingFrameworkEnabled;
    if (!isDockingFrameworkEnabled) return;

    splashWindow.notifyOfStep(SplashWindow.STEP_OR_INIT_DOCKING_FRAME);

    //init the ccontrol
    control = new CControl( this );
    control.setTheme(DEFAULT_THEME);
    add( control.getContentArea() );
    if ("en_us".equalsIgnoreCase(Config.get("locale"))) {
        //hard setting to default in case of US as this is DockingFrames default language
        //don't use Locale constant as it is en_US (case sensitive)
        control.setLanguage(new Locale(""));
    }

    //init the grid layout
    gridLayout = new CGrid( control );

    //ensure that externalized dockables get a split station as parent
    //necessary, otherwise externalized dockables cannot be docked together
    alwaysAddStationsToExternalizedDockables(control);


}
 
Example #2
Source File: DockingManager.java    From openAGV with Apache License 2.0 4 votes vote down vote up
/**
 * Wraps all given JComponents into a dockable and deploys them on the CControl.
 *
 * @param frame
 * @param vehiclesPanel
 * @param fTreeView
 * @param fBlocksView
 * @param fGroupsView
 * @param fPropertiesComponent
 * @param statusScrollPane
 */
public void initializeDockables(JFrame frame,
                                JComponent vehiclesPanel,
                                TreeView fTreeView,
                                TreeView fBlocksView,
                                TreeView fGroupsView,
                                JComponent fPropertiesComponent,
                                JComponent statusScrollPane) {
  Objects.requireNonNull(frame, "frame is null");
  Objects.requireNonNull(vehiclesPanel, "vehiclesPane is null");
  Objects.requireNonNull(fTreeView, "fTreeView is null");
  Objects.requireNonNull(fBlocksView, "fBlocksView is null");
  Objects.requireNonNull(fGroupsView, "fGroupsView is null");
  Objects.requireNonNull(fPropertiesComponent, "fPropertiesComponent is null");
  Objects.requireNonNull(statusScrollPane, "statusScrollPane is null");

  control = new CControl(frame);
  control.setGroupBehavior(CGroupBehavior.TOPMOST);

  // Disable keyboard shortcuts to avoid collisions.
  control.putProperty(CControl.KEY_GOTO_NORMALIZED, null);
  control.putProperty(CControl.KEY_GOTO_EXTERNALIZED, null);
  control.putProperty(CControl.KEY_GOTO_MAXIMIZED, null);
  control.putProperty(CControl.KEY_MAXIMIZE_CHANGE, null);

  ResourceBundleUtil bundleTreeView = ResourceBundleUtil.getBundle(I18nPlantOverview.TREEVIEW_PATH);
  CGrid grid = new CGrid(control);
  courseTabPane = new CStack(COURSE_TAB_PANE_ID);
  tabPanes.put(COURSE_TAB_PANE_ID, courseTabPane);
  DefaultSingleCDockable vehiclesDockable
      = createDockable(VEHICLES_DOCKABLE_ID,
                       vehiclesPanel.getAccessibleContext().getAccessibleName(),
                       vehiclesPanel,
                       false);
  treeTabPane = new CStack(TREE_TAB_PANE_ID);
  tabPanes.put(TREE_TAB_PANE_ID, treeTabPane);
  DefaultSingleCDockable treeViewDock
      = createDockable(COMPONENTS_ID,
                       bundleTreeView.getString("dockingManager.panel_components.title"),
                       (JComponent) fTreeView,
                       false);
  DefaultSingleCDockable treeBlocks
      = createDockable(BLOCKS_ID,
                       bundleTreeView.getString("dockingManager.panel_blocks.title"),
                       (JComponent) fBlocksView,
                       false);
  DefaultSingleCDockable treeGroups
      = createDockable(GROUPS_ID,
                       bundleTreeView.getString("dockingManager.panel_groups.title"),
                       (JComponent) fGroupsView,
                       false);

  grid.add(0, 0, 250, 400, treeTabPane);
  grid.add(0, 400, 250, 400,
           createDockable(PROPERTIES_ID,
                          ResourceBundleUtil.getBundle(I18nPlantOverview.PROPERTIES_PATH)
                              .getString("dockingManager.panel_properties.title"),
                          fPropertiesComponent,
                          false));
  grid.add(0, 800, 250, 200,
           createDockable(STATUS_ID,
                          ResourceBundleUtil.getBundle(I18nPlantOverview.STATUS_PATH)
                              .getString("dockingManager.panel_status.title"),
                          statusScrollPane,
                          false));
  grid.add(250, 0, 150, 500, vehiclesDockable);
  grid.add(400, 0, 1000, 500, courseTabPane);

  control.getContentArea().deploy(grid);

  // init tab panes
  addTabTo(treeViewDock, TREE_TAB_PANE_ID, 0);
  addTabTo(treeBlocks, TREE_TAB_PANE_ID, 1);
  addTabTo(treeGroups, TREE_TAB_PANE_ID, 2);
  treeTabPane.getStation().setFrontDockable(treeViewDock.intern());
}
 
Example #3
Source File: SLDEditorDockableLayout.java    From sldeditor with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void createUI(
        SLDEditorInterface application,
        SLDEditorUIPanels uiMgr,
        List<ExtensionInterface> extensionList) {
    JFrame frame = Controller.getInstance().getFrame();

    control = new CControl(frame);

    frame.setLayout(new GridLayout(1, 1));
    frame.add(control.getContentArea());

    CGrid grid = new CGrid(control);
    SingleCDockable legend =
            create(
                    Localisation.getString(SLDEditorDockableLayout.class, "panels.legend"),
                    (JPanel) uiMgr.getLegendData());
    SingleCDockable symbol =
            create(
                    Localisation.getString(SLDEditorDockableLayout.class, "panels.symbol"),
                    uiMgr.getSLDSymbolData());
    SingleCDockable sld =
            create(
                    Localisation.getString(SLDEditorDockableLayout.class, "panels.sld"),
                    SLDTextArea.getPanel());
    SingleCDockable map =
            create(
                    Localisation.getString(SLDEditorDockableLayout.class, "panels.map"),
                    RenderPanelFactory.getMapRenderer());
    SingleCDockable dataSource =
            create(
                    Localisation.getString(SLDEditorDockableLayout.class, "panels.dataSource"),
                    uiMgr.getDataSourceConfig());
    SingleCDockable vendorOption =
            create(
                    Localisation.getString(
                            SLDEditorDockableLayout.class, "panels.vendorOption"),
                    uiMgr.getVendorOption());

    SingleCDockable console =
            create(
                    Localisation.getString(SLDEditorDockableLayout.class, "panels.console"),
                    ConsoleManager.getInstance().getPanel());

    control.addDockable(sld);
    control.addDockable(legend);
    control.addDockable(symbol);
    control.addDockable(map);
    control.addDockable(dataSource);
    control.addDockable(vendorOption);
    control.addDockable(console);

    ToolManager toolManagerInstance = ToolManager.getInstance();
    toolManagerInstance.setApplication(application);

    for (ExtensionInterface extension : extensionList) {
        extension.initialise(application.getLoadSLDInterface(), toolManagerInstance);

        SingleCDockable dockablePlugin = create(extension.getName(), extension.getPanel());
        control.addDockable(dockablePlugin);
        grid.add(0, 0, 1, 4, dockablePlugin);
    }

    grid.add(1, 0, 2, 4, sld);
    grid.add(1, 0, 2, 4, legend);
    grid.add(1, 0, 2, 4, map);
    grid.add(1, 0, 2, 4, dataSource);
    grid.add(1, 0, 2, 4, vendorOption);
    grid.add(1, 0, 2, 4, symbol);

    grid.add(0, 4, 3, 1, console);

    CContentArea content = control.getContentArea();
    content.deploy(grid);
}