Bubble theme

First, thanks for writing docking frames. It is excellent.

I really like the Bubble theme, some comments / suggestions:

1 Please provide a way to reduce the transition speed. I think 300-500 ms is enough time for transition, otherwise it is distracting to the user. I see there is a setter on BubbleColorAnimation, but animation has private access in AbstractBubbleDockTitle. Please expose it in the API or in the preferences.

2 In a selected window the title will fade on mouseover. Does this make sense? The window is already selected. I can see it makes sense for non-selected windows.

3 When selecting a window the title color will not make the full transition if the mouse is still on it. The window is selected, please make the full transition. This is related to #2

4 I notice docking frames doesn’t use JToolBars at all, but it would be interesting to see a bubble tool bar. I’m going to try some ideas myself.

5 I’m trying to configure the flap / minimize area using the common framework. Is there someway to set it to be the area to be used. Here is my example building off the paint example

    workingArea = control.createWorkingArea("working");
    workingArea.setLocation(CLocation.base().normalRectangle(0, 0, 1, 1));
    workingArea.setVisible(true);

    minimizeArea = control.createMinimizeArea("minimize");
    minimizeArea.setDirection(FlapDockStation.Direction.WEST);
    minimizeArea.setVisible(true);

Keep up the great work!

  1. I can do that, but it will have to wait for the next version.
    2 + 3: You can make your own Color-scheme by subclassing “BubbleColorScheme”, there you can set the roll-over color to be equal to the normal color, thus no animation to see. To apply your new scheme use the properties key “BubbleTheme.BUBBLE_COLOR_SCHEME” and call “ccontrol.putProperty(…)”.
  2. I once thought of writing my own toolbar, but I never started with it…
  3. I don’t understand where exactly the problem is. The CMinimizeArea is a JPanel, you’ll have to add it somewhere on your frame/dialog/window/applet. The paint example itself uses a CContentArea (ccontrol.getContentArea) which is a combination of minimize-areas and a grid-area.

1 - great

2+3 - thanks for the hint

private static class CustomBubbleColorScheme extends BubbleColorScheme{
    public CustomBubbleColorScheme() {
        setColor( "title.background.top.active.mouse",         getColor("title.background.top.active") );
        setColor( "title.background.bottom.active.mouse",      getColor("title.background.bottom.active") );
    }
}

5 - I’m using the CContentArea. After some more reading I figured out the correct way to configure the minimize area.

    final CMinimizedMode cMinimizedMode = control.getLocationManager().getMinimizedMode();
    cMinimizedMode.setDefaultArea(cMinimizedMode.get(CContentArea.getWestIdentifier(CControl.CONTENT_AREA_STATIONS_ID)));

About the toolbar… I started by just adding a simple gradient paint to the existing JToolBar and it looks better. Don’t forget to call setContentAreaFilled(false) on any toolbar items

 private static class GradientJToolBar extends JToolBar {

    private GradientJToolBar() {
        setOpaque(false);
    }

    @Override
    protected void paintComponent(Graphics g) {
        Graphics2D g2 = (Graphics2D) g.create();
        int width = getWidth();
        int height = getHeight();
        g2.setPaint(new GradientPaint(0, 0, Color.WHITE, 0, height, Color.RED));
        g2.fillRect(0, 0, width, height);
        g2.dispose();
        super.paintComponent(g);
    }
}