本文整理汇总了Java中bibliothek.gui.dock.common.CControl类的典型用法代码示例。如果您正苦于以下问题:Java CControl类的具体用法?Java CControl怎么用?Java CControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CControl类属于bibliothek.gui.dock.common包,在下文中一共展示了CControl类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLayout
import bibliothek.gui.dock.common.CControl; //导入依赖的package包/类
/**
* This method simulates the creation of a layout.
*
* @param display the component to display
* @param input array list
* @return element
*/
public static XElement createLayout(Component display, ArrayList<ImmutablePair<String, Component>> input) {
/* This method simulates the creation of a layout */
CControl control = new CControl();
control.getContentArea();
CGrid grid = new CGrid(control);
DefaultSingleCDockable displayDock = display != null ? new ControllerBase.TorgoSingleDockable("Display", display) : null;
if (displayDock != null) {
grid.add(0, 0, 10, 10, displayDock);
displayDock.setLocation(CLocation.base().minimalWest());
displayDock.setExtendedMode(ExtendedMode.NORMALIZED);
}
int count = 1;
for (ImmutablePair<String, Component> key : input) {
DefaultSingleCDockable dock = new ControllerBase.TorgoSingleDockable(key.left, key.right);
grid.add(10, 0, 6, count, dock);
dock.setExtendedMode(ExtendedMode.NORMALIZED);
count += 1;
}
control.getContentArea().deploy(grid);
XElement root = new XElement("root");
control.writeXML(root);
control.destroy();
return root;
}
示例2: CodeEditorWindow
import bibliothek.gui.dock.common.CControl; //导入依赖的package包/类
public CodeEditorWindow() {
setContentPane(contentPane);
control = new CControl(this);
base = CLocation.base();
control.setTheme(ThemeMap.KEY_ECLIPSE_THEME);
setContentPane(control.getContentArea());
RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
textArea.setCodeFoldingEnabled(true);
textArea.setFont(new Font("Ubuntu Mono", textArea.getFont().getStyle(), 14));
Theme theme = null;
try {
theme = Theme.load(getClass().getResourceAsStream("/org/fife/ui/rsyntaxtextarea/themes/dark.xml"));
theme.apply(textArea);
} catch (IOException e) {
e.printStackTrace();
}
RTextScrollPane sp = new RTextScrollPane(textArea);
DefaultSingleCDockable dockable = new DefaultSingleCDockable("code", "sss", sp);
dockable.setCloseable(true);
dockable.setExternalizable(false);
CGrid grid = new CGrid(control);
grid.add(0, 0, 1, 1, createDockable("scripts", Color.CYAN));
grid.add(1, 0, 8, 7, createDockable("* main.fjs", Color.CYAN));
grid.add(1, 0, 8, 7, createDockable("* log.fjs", Color.CYAN));
grid.add(1, 0, 8, 7, dockable);
grid.add(0, 8, 9, 2, createDockable("Logs", Color.BLACK));
control.getContentArea().deploy(grid);
}
示例3: loadState
import bibliothek.gui.dock.common.CControl; //导入依赖的package包/类
private static boolean loadState(CControl control) {
File layoutFile = getLayoutFile();
if (!layoutFile.exists()) {
return false;
}
try {
control.readXML(layoutFile);
return true;
} catch (IOException e) {
throw Throwables.propagate(e);
}
}
示例4: saveState
import bibliothek.gui.dock.common.CControl; //导入依赖的package包/类
private static void saveState(CControl control) {
try {
control.writeXML(getLayoutFile());
} catch (IOException e) {
throw Throwables.propagate(e);
}
}
示例5: createUI
import bibliothek.gui.dock.common.CControl; //导入依赖的package包/类
@Override
public void createUI(SLDEditorInterface application, SLDEditorUIPanels uiMgr,
List<ExtensionInterface> extensionList) {
JFrame frame = application.getApplicationFrame();
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);
}
示例6: GuiMain
import bibliothek.gui.dock.common.CControl; //导入依赖的package包/类
/**
* CONSTRUCTOR
*/
public GuiMain(boolean ismultithread) {
this.ismultithread = ismultithread;
this.rootframe = new JFrame("Cruise Control");
this.rootframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
CControl control = new CControl( this.rootframe );
this.rootframe.setLayout(new BorderLayout());
this.rootframe.add( control.getContentArea(), BorderLayout.CENTER );
control.setTheme(ThemeMap.KEY_ECLIPSE_THEME);
this.scheduledrawer = createScheduledrawer();
this.waterdrawer = createWaterdrawer();
this.powersumsdrawer = createPowerSumsdrawer();
this.devicetable = createDevicetable();
this.stateviewer = createStateViewer();
// IMPORTANT: CruiseControl must be the last one to be in front of the others!
this.cruisecontrol = createCruisecontrol();
SingleCDockable scheduledock = new DefaultSingleCDockable("scheduledrawer", "Schedule", this.scheduledrawer);
SingleCDockable waterdock = new DefaultSingleCDockable("waterdrawer", this.waterdrawer.getName(), this.waterdrawer);
SingleCDockable powersumsdock = new DefaultSingleCDockable("powersumsdrawer", this.powersumsdrawer.getName(), this.powersumsdrawer);
SingleCDockable devicetabledock = new DefaultSingleCDockable("devicetable", "Device Table", this.devicetable);
SingleCDockable stateviewerdock = new DefaultSingleCDockable("stateviewer", "Registry State Viewer", this.stateviewer);
SingleCDockable cruisecontroldock = new DefaultSingleCDockable("cruisecontrol", "Cruise Control", this.cruisecontrol);
control.addDockable( scheduledock );
control.addDockable( waterdock );
control.addDockable( powersumsdock );
control.addDockable( devicetabledock );
control.addDockable( stateviewerdock );
control.addDockable( cruisecontroldock );
CContentAreaCenterLocation normal = CLocation.base().normal();
scheduledock.setLocation(normal);
waterdock.setLocation(normal.stack());
powersumsdock.setLocation(normal.stack());
TreeLocationRoot south = CLocation.base().normalSouth(0.4);
devicetabledock.setLocation(south);
stateviewerdock.setLocation(south.stack());
TreeLocationRoot north = CLocation.base().normalNorth(0.1);
cruisecontroldock.setLocation(north);
scheduledock.setVisible(true);
waterdock.setVisible(true);
powersumsdock.setVisible(true);
devicetabledock.setVisible(true);
stateviewerdock.setVisible(true);
cruisecontroldock.setVisible(true);
this.rootframe.pack();
this.rootframe.setBounds( 50, 50, 1000, 700 );
this.rootframe.setVisible(true);
}
示例7: GuiMain
import bibliothek.gui.dock.common.CControl; //导入依赖的package包/类
/**
* CONSTRUCTOR
*/
public GuiMain(boolean ismultithread) {
this.ismultithread = ismultithread;
this.rootframe = new JFrame("OSH Simulation GUI");
this.rootframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.control = new CControl( this.rootframe );
this.rootframe.setLayout(new BorderLayout());
this.rootframe.add( control.getContentArea(), BorderLayout.CENTER );
control.setTheme(ThemeMap.KEY_ECLIPSE_THEME);
this.scheduledrawer = createScheduledrawer();
// this.waterdrawer = createWaterdrawer();
this.powersumsdrawer = createPowerSumsdrawer();
this.devicetable = createDevicetable();
this.stateviewer = createStateViewer();
//cruisecontrol must be the last one to be in front of the others
this.cruisecontrol = createCruisecontrol();
SingleCDockable scheduledock = new DefaultSingleCDockable("scheduledrawer", "Schedule", this.scheduledrawer);
// SingleCDockable waterdock = new DefaultSingleCDockable("waterdrawer", this.waterdrawer.getName(), this.waterdrawer);
SingleCDockable powersumsdock = new DefaultSingleCDockable("powersumsdrawer", this.powersumsdrawer.getName(), this.powersumsdrawer);
SingleCDockable devicetabledock = new DefaultSingleCDockable("devicetable", "Device Table", this.devicetable);
SingleCDockable stateviewerdock = new DefaultSingleCDockable("stateviewer", "Registry State Viewer", this.stateviewer);
SingleCDockable cruisecontroldock = new DefaultSingleCDockable("cruisecontrol", "OSH Simulation GUI", this.cruisecontrol);
control.addDockable( scheduledock );
// control.addDockable( waterdock );
control.addDockable( powersumsdock );
control.addDockable( devicetabledock );
control.addDockable( stateviewerdock );
control.addDockable( cruisecontroldock );
normalLocation = CLocation.base().normal();
scheduledock.setLocation(normalLocation);
// waterdock.setLocation(normal.stack());
powersumsdock.setLocation(normalLocation.stack());
TreeLocationRoot south = CLocation.base().normalSouth(0.4);
devicetabledock.setLocation(south);
stateviewerdock.setLocation(south.stack());
TreeLocationRoot north = CLocation.base().normalNorth(0.1);
cruisecontroldock.setLocation(north);
scheduledock.setVisible(true);
// waterdock.setVisible(true);
powersumsdock.setVisible(true);
devicetabledock.setVisible(true);
stateviewerdock.setVisible(true);
cruisecontroldock.setVisible(true);
this.rootframe.pack();
this.rootframe.setBounds( 50, 50, 1000, 700 );
this.rootframe.setVisible(true);
}
示例8: getControl
import bibliothek.gui.dock.common.CControl; //导入依赖的package包/类
public CControl getControl() {
return control;
}
示例9: setControl
import bibliothek.gui.dock.common.CControl; //导入依赖的package包/类
public void setControl(CControl control) {
this.control = control;
}