[TeamTalk 129]: [666] TeamTalk/Agents/PenDecoder: console now support undocking
tk@edam.speech.cs.cmu.edu
tk at edam.speech.cs.cmu.edu
Sat Jul 21 02:42:06 EDT 2007
An HTML attachment was scrubbed...
URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20070721/11f5ef9f/attachment.html
-------------- next part --------------
Added: TeamTalk/Agents/PenDecoder/Untitled
===================================================================
(Binary files differ)
Property changes on: TeamTalk/Agents/PenDecoder/Untitled
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: TeamTalk/Agents/PenDecoder/nbproject/genfiles.properties
===================================================================
--- TeamTalk/Agents/PenDecoder/nbproject/genfiles.properties 2007-07-20 23:05:01 UTC (rev 665)
+++ TeamTalk/Agents/PenDecoder/nbproject/genfiles.properties 2007-07-21 06:42:04 UTC (rev 666)
@@ -5,4 +5,4 @@
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=6ba8dec9
nbproject/build-impl.xml.script.CRC32=714dbfa4
-nbproject/build-impl.xml.stylesheet.CRC32=65d7ca21
+nbproject/build-impl.xml.stylesheet.CRC32=20b9345e
Modified: TeamTalk/Agents/PenDecoder/src/edu/cmu/ravenclaw/pendecoder/PenDecoderDisplay.java
===================================================================
--- TeamTalk/Agents/PenDecoder/src/edu/cmu/ravenclaw/pendecoder/PenDecoderDisplay.java 2007-07-20 23:05:01 UTC (rev 665)
+++ TeamTalk/Agents/PenDecoder/src/edu/cmu/ravenclaw/pendecoder/PenDecoderDisplay.java 2007-07-21 06:42:04 UTC (rev 666)
@@ -100,8 +100,9 @@
oldViewSize = viewport.getSize();
}
- //clear map canvas from docked frame
+ //clear map canvas and console from docked frame
dockedRootPane.setContentPane(new JPanel());
+ lowerContainer.remove(console);
//build undocked viewpane and set paramters congruent with docked parameters
JScrollPane pane = new JScrollPane(mapCanvas);
@@ -109,19 +110,23 @@
pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
Dimension newSize = new Dimension(dockSize.width*320/oldViewSize.width,
dockSize.height*320/oldViewSize.width);
- Dimension newViewSize = new Dimension(320, 320*oldViewSize.height/oldViewSize.width);
mapCanvas.setPreferredSize(newSize);
mapCanvas.setSize(newSize);
pane.getViewport().setViewPosition(new Point(dockAnchor.x*320/oldViewSize.width,
dockAnchor.y*320/oldViewSize.width));
- //resize undocked frame and attach undocked map viewpane
+ //resize undocked frames and attach components
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
- mapCanvasFrame.setBounds(0, screenSize.height-newViewSize.height,
- newViewSize.width, newViewSize.height);
+ Dimension newMapViewSize = new Dimension(320, 320*oldViewSize.height/oldViewSize.width);
+ mapCanvasFrame.setBounds(0, screenSize.height-newMapViewSize.height,
+ newMapViewSize.width, newMapViewSize.height);
mapCanvasFrame.setContentPane(pane);
+ mapCanvasFrame.setVisible(true);
+ consoleFrame.setBounds(newMapViewSize.width, screenSize.height-100,
+ screenSize.width-640, 100);
+ consoleFrame.setContentPane(console);
+ consoleFrame.setVisible(true);
- mapCanvasFrame.setVisible(true);
docked = false;
}
@@ -130,9 +135,11 @@
*/
public void dock() {
mapCanvasFrame.setVisible(false);
+ consoleFrame.setVisible(false);
- //clear map canvas from undocked frame
+ //clear components from undocked frame
mapCanvasFrame.setContentPane(new JPanel());
+ consoleFrame.setContentPane(new JPanel());
//build docked viewpane and restore viewpane parameters
JScrollPane pane = new JScrollPane(mapCanvas);
@@ -142,8 +149,9 @@
mapCanvas.setSize(dockSize);
pane.getViewport().setViewPosition(dockAnchor);
- //reattach docked viewpane
+ //reattach components
dockedRootPane.setContentPane(pane);
+ lowerContainer.add(console, BorderLayout.CENTER);
dockedFrame.setVisible(true);
docked = true;
@@ -187,7 +195,7 @@
dockedFrame.getContentPane().add(toolbar, BorderLayout.WEST);
//console and imager
- JPanel lowerContainer = new JPanel(new BorderLayout());
+ lowerContainer = new JPanel(new BorderLayout());
lowerContainer.add(console, BorderLayout.CENTER);
lowerContainer.add(imager, BorderLayout.EAST);
dockedFrame.getContentPane().add(lowerContainer, BorderLayout.SOUTH);
@@ -207,8 +215,9 @@
mapCanvasFrame = new JFrame();
mapCanvasFrame.setUndecorated(true);
mapCanvasFrame.setAlwaysOnTop(true);
- Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
- mapCanvasFrame.setBounds(0, screenSize.height-200, 320, 200);
+ consoleFrame = new JFrame();
+ consoleFrame.setUndecorated(true);
+ consoleFrame.setAlwaysOnTop(true);
}
/**
@@ -592,12 +601,22 @@
protected JFrame mapCanvasFrame;
/**
+ * The undocked console frame
+ */
+ protected JFrame consoleFrame;
+
+ /**
* This is the root pane for the docked map canvas. It is a container for the
* JScrollPane which has the map and the GlassPane which has the floating logo.
*/
protected JRootPane dockedRootPane;
/**
+ * A container that contains the console and the robot camera imager.
+ */
+ protected JPanel lowerContainer;
+
+ /**
* The dimensions of the docked map canvas viewpane. This is used to fix the
* aspect ratio of the undocked map canvas, and also to reaquire the settings
* for when the map canvas is redocked.
More information about the TeamTalk-developers
mailing list