Permalink
Browse files

working on tabmanager

  • Loading branch information...
1 parent 6dd1fa1 commit 7371ac7b4358f9999b8b50b0a407f4ae084e0a02 @zk committed Feb 1, 2009
View
@@ -33,6 +33,13 @@
<component name="DependencyValidationManager">
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</component>
+ <component name="EclipseCompilerSettings">
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="true" />
+ <option name="DEPRECATION" value="false" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
+ </component>
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
<component name="FacetAutodetectingManager">
<autodetection-disabled>
@@ -80,6 +87,14 @@
<option name="LOCALE" />
<option name="OPEN_IN_BROWSER" value="true" />
</component>
+ <component name="JikesSettings">
+ <option name="JIKES_PATH" value="" />
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="DEPRECATION" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="false" />
+ <option name="IS_EMACS_ERRORS_MODE" value="true" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ </component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
@@ -563,6 +578,7 @@
</library>
</component>
<UsedPathMacros>
+ <macro name="M2_HOME" />
<macro name="MAVEN_REPOSITORY" description="Maven Local Repostiry" />
</UsedPathMacros>
</project>
View
@@ -76,16 +76,25 @@
<file leaf-file-name="SimUI.groovy" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/main/groovy/napplelabs/dbssim/ui/SimUI.groovy">
<provider selected="true" editor-type-id="text-editor">
- <state line="102" column="27" selection-start="3982" selection-end="3982" vertical-scroll-proportion="0.4477612">
+ <state line="27" column="33" selection-start="869" selection-end="869" vertical-scroll-proportion="-1.7510917">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="TabMonitor.groovy" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/main/groovy/napplelabs/dbssim/ui/TabMonitor.groovy">
+ <file leaf-file-name="TracePApplet.java" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/src/main/groovy/napplelabs/dbssim/ui/TracePApplet.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="59" column="36" selection-start="1927" selection-end="1927" vertical-scroll-proportion="0.0">
+ <state line="1" column="16" selection-start="30" selection-end="30" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="TabManager.groovy" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/src/main/groovy/napplelabs/dbssim/ui/TabManager.groovy">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="66" column="69" selection-start="2038" selection-end="2038" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -107,6 +116,13 @@
<setting name="OPEN_NEW_TAB" value="false" />
</FindUsagesManager>
</component>
+ <component name="MavenImportPreferences">
+ <option name="generalSettings">
+ <MavenGeneralSettings>
+ <option name="mavenHome" value="$M2_HOME$" />
+ </MavenGeneralSettings>
+ </option>
+ </component>
<component name="ModuleEditorState">
<option name="LAST_EDITED_MODULE_NAME" />
<option name="LAST_EDITED_TAB_NAME" />
@@ -218,6 +234,10 @@
<option name="myItemId" value="napplelabs" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="resources" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@@ -313,10 +333,14 @@
<component name="PropertiesComponent">
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
+ <property name="options.splitter.main.proportions" value="0.3" />
<property name="RunManagerConfig.showSettingsBeforeRunnig" value="true" />
+ <property name="options.lastSelected" value="MavenSettings" />
<property name="MemberChooser.sorted" value="false" />
<property name="MemberChooser.showClasses" value="true" />
<property name="GoToClass.includeLibraries" value="false" />
+ <property name="options.searchVisible" value="true" />
+ <property name="options.splitter.details.proportions" value="0.2" />
<property name="MemberChooser.copyJavadoc" value="false" />
</component>
<component name="RunManager" selected="Application.SimUI">
@@ -338,6 +362,47 @@
<option name="Make" value="true" />
</method>
</tempConfiguration>
+ <configuration default="true" type="MavenRunConfiguration" factoryName="Maven">
+ <MavenSettings>
+ <option name="myCoreSettings">
+ <MavenGeneralSettings>
+ <option name="checksumPolicy" value="fail" />
+ <option name="failureBehavior" value="fail-fast" />
+ <option name="localRepository" value="" />
+ <option name="mavenHome" value="" />
+ <option name="mavenSettingsFile" value="" />
+ <option name="nonRecursive" value="false" />
+ <option name="pluginUpdatePolicy" value="false" />
+ <option name="printErrorStackTraces" value="false" />
+ <option name="usePluginRegistry" value="false" />
+ <option name="workOffline" value="false" />
+ </MavenGeneralSettings>
+ </option>
+ <option name="myRunnerSettings">
+ <MavenRunnerSettings>
+ <option name="jreName" value="1.6" />
+ <option name="mavenProperties">
+ <map />
+ </option>
+ <option name="runMavenInBackground" value="false" />
+ <option name="skipTests" value="false" />
+ <option name="vmOptions" value="" />
+ </MavenRunnerSettings>
+ </option>
+ <option name="myRunnerParameters">
+ <MavenRunnerParameters>
+ <option name="goals">
+ <list />
+ </option>
+ <option name="profiles">
+ <set />
+ </option>
+ <option name="workingDirPath" value="" />
+ </MavenRunnerParameters>
+ </option>
+ </MavenSettings>
+ <method />
+ </configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
@@ -485,15 +550,15 @@
<window_info id="IDEtalk Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" />
<window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" />
- <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.22580644" sideWeight="0.5" order="-1" side_tool="false" />
+ <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.22580644" sideWeight="0.5" order="-1" side_tool="false" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" />
- <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32954547" sideWeight="0.6605223" order="-1" side_tool="false" />
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.76344085" order="0" side_tool="false" />
+ <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32954547" sideWeight="0.79877114" order="-1" side_tool="false" />
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.79877114" order="0" side_tool="false" />
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" />
- <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32872504" sideWeight="0.5" order="2" side_tool="false" />
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.1904762" sideWeight="0.5" order="2" side_tool="false" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" />
@@ -573,16 +638,23 @@
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/main/groovy/napplelabs/dbssim/ui/TabMonitor.groovy">
+ <entry file="file://$PROJECT_DIR$/src/main/groovy/napplelabs/dbssim/ui/TabManager.groovy">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="66" column="69" selection-start="2038" selection-end="2038" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/src/main/groovy/napplelabs/dbssim/ui/TracePApplet.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="59" column="36" selection-start="1927" selection-end="1927" vertical-scroll-proportion="0.0">
+ <state line="1" column="16" selection-start="30" selection-end="30" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/groovy/napplelabs/dbssim/ui/SimUI.groovy">
<provider selected="true" editor-type-id="text-editor">
- <state line="102" column="27" selection-start="3982" selection-end="3982" vertical-scroll-proportion="0.4477612">
+ <state line="27" column="33" selection-start="869" selection-end="869" vertical-scroll-proportion="-1.7510917">
<folding />
</state>
</provider>
@@ -620,7 +692,13 @@
<value>
<UIState>
<option name="proportions">
- <SplitterProportionsDataImpl />
+ <SplitterProportionsDataImpl>
+ <option name="proportions">
+ <list>
+ <option value="0.2" />
+ </list>
+ </option>
+ </SplitterProportionsDataImpl>
</option>
</UIState>
</value>
@@ -658,7 +736,13 @@
<value>
<UIState>
<option name="proportions">
- <SplitterProportionsDataImpl />
+ <SplitterProportionsDataImpl>
+ <option name="proportions">
+ <list>
+ <option value="0.2" />
+ </list>
+ </option>
+ </SplitterProportionsDataImpl>
</option>
</UIState>
</value>
@@ -1,8 +1,32 @@
package napplelabs.dbssim.ui
-import ddf.minim.Minim
-import ddf.minim.AudioOutput
-import napplelabs.dbssim.NeuronSignal
+import ddf.minim.Minim
+import ddf.minim.AudioOutput
+import napplelabs.dbssim.NeuronSignal
+import napplelabs.dbssim.TracePanel
+import ddf.minim.signals.PinkNoise
+import java.awt.BorderLayout
+import com.explodingpixels.macwidgets.MacButtonFactory
+import javax.swing.AbstractButton
+import javax.swing.JButton
+import javax.swing.ImageIcon
+import javax.swing.JToggleButton
+import javax.swing.ButtonGroup
+import com.explodingpixels.macwidgets.LabeledComponentGroup
+import java.awt.event.ActionListener
+import javax.swing.SwingUtilities
+import java.lang.Runnable
+import javax.swing.JComponent
+import javax.swing.JPanel
+import javax.swing.JLabel
+import com.explodingpixels.macwidgets.HudWindow
+import java.awt.Dimension
+import ddf.minim.AudioPlayer
+import processing.core.PApplet
+import napplelabs.dbssim.SignalContainer
+import java.awt.Component
+
+class SimUI {
MacFrame mf
Component currentComponent = new JPanel()
Component tracePanel = new JPanel()
@@ -66,46 +90,19 @@ import napplelabs.dbssim.SignalContainer import java.awt.Component class SimUI
mf.addToolbarComponentRight(playButton)
final JPanel canvasPanel = new JPanel()
-
-
-
-
-
- //final TracePanel panel = new TracePanel(out, player);
- //panel.start()
-
- //mf.content.add(panel, BorderLayout.CENTER)
-
- AbstractButton playButton =
- MacButtonFactory.makeUnifiedToolBarButton(
- new JButton("Control", new ImageIcon(SimUI.class.getResource(
- "/napplelabs/resources/dotmac.png"))));
-
- playButton.addActionListener({
- SwingUtilities.invokeLater({
- controlHud.visible = true
- } as Runnable)
- } as ActionListener)
-
- mf.addToolbarComponentRight(playButton)
-
- final JPanel canvasPanel = new JPanel()
-
- JToggleButton control = new JToggleButton("Canvas");
- control.putClientProperty("JButton.buttonType", "segmentedTextured");
- control.putClientProperty("JButton.segmentPosition", "first");
- control.setFocusable(false);
- control.addActionListener({
- currentComponent = canvasPanel
- SwingUtilities.invokeLater({
- mf.content.repaint()
- mf.revalidate()
+
tracePanel = new TracePApplet(container)
- } as ActionListener);
-
- JToggleButton trace = new JToggleButton("Trace");
+ tracePanel.init()
+
+ TabManager tabManager = new TabManager(mf.content)
+ tabManager.add("Canvas", canvasPanel)
+ tabManager.add("Trace", tracePanel)
+
+ tabManager.load("Canvas");
- trace.putClientProperty("JButton.segmentPosition", "last");
+
+
+ mf.addToolbarComponentCenter(tabManager.build().component)
mf.frame.visible = true
@@ -117,12 +114,6 @@ import napplelabs.dbssim.SignalContainer import java.awt.Component class SimUI
}
- group.add(trace)
-
- LabeledComponentGroup viewButtons = new LabeledComponentGroup(null, control, trace);
- mf.addToolbarComponentCenter(viewButtons.component)
-
- //TracePanel panel = new TracePanel(container)
public JComponent getCurrentComponent() {
return currentComponent
}
@@ -10,6 +10,7 @@ import javax.swing.JToggleButton
import java.awt.event.ActionListener
import javax.swing.JPanel
import javax.swing.SwingUtilities
+import java.awt.BorderLayout
/**
* Created by IntelliJ IDEA.
@@ -19,16 +20,19 @@ import javax.swing.SwingUtilities
* To change this template use File | Settings | File Templates.
*/
-public class TabMonitor {
+public class TabManager {
List<String> tabNames = []
Map<String, Component> tabComponents = [:]
Component currentComponent = new JPanel()
+ JPanel parent
- public TabMonitor() {
+ public TabManager(JPanel parent) {
+ this.parent = parent
}
- public TabMonitor add(String name, Component comp) {
+
+ public TabManager add(String name, Component comp) {
tabNames += name
tabComponents.put(name, comp)
}
@@ -51,7 +55,6 @@ public class TabMonitor {
control.setFocusable(false);
control.addActionListener({
- def parent = currentComponent.parent
currentComponent = tabComponents[name]
SwingUtilities.invokeLater({
parent.repaint()
@@ -67,5 +70,13 @@ public class TabMonitor {
LabeledComponentGroup viewButtons = new LabeledComponentGroup(null, controls);
}
-
+
+ public void load(String name) {
+ def component = tabComponents[name]
+ if(!component) return
+
+ parent.remove(currentComponent)
+ currentComponent = component
+ parent.add currentComponent, BorderLayout.CENTER
+ }
}
Oops, something went wrong. Retry.

0 comments on commit 7371ac7

Please sign in to comment.