Eclipse Theme does not show drag marker

even for demo app:

Eclipse Theme does not show drag marker, when moving a dockable
outside of a central station into screen station;

is this normal?

Yeah, the Eclipse theme does not paint many markers. Just like Eclipse which does not paint many markers too (at least at the time when the theme was written).

got it; and easy way to fix this is…?

In theory replacing the current StationPaint either by extending EclipseTheme or by calling “setPaint” on EclipseTheme might help. The StationPaint draws all the markings, just use one of the other Default StationPaint’s to test.

I’m going to redesign the themes in 1.1.0, so any “fix” now has a good chance from being obsolete later.

the eclipse paint from

package bibliothek.extension.gui.dock.theme.eclipse;

looks like it should paint something when dragging in externalized state;
may be problem is in some other place?



/**
 * @author Janni Kovacs
 */
public class EclipseStationPaint implements StationPaint {
	
	public void drawInsertionLine(Graphics g, DockStation station, int x1, int y1, int x2, int y2) {
		Graphics2D g2d = (Graphics2D) g;
		g2d.setStroke(new BasicStroke(2f));
		g.drawLine(x1, y1, x2, y2);
	}

	public void drawDivider(Graphics g, DockStation station, Rectangle bounds) {
		if (station instanceof SplitDockStation && !((SplitDockStation) station).isContinousDisplay()) {
			g.fillRect(bounds.x, bounds.y, bounds.width, bounds.height);
		}
	}

	public void drawInsertion(Graphics g, DockStation station, Rectangle stationBounds, Rectangle dockableBounds) {
		Graphics2D g2d = (Graphics2D) g;
		g2d.setStroke(new BasicStroke(2f));
		g.drawRect(dockableBounds.x+1, dockableBounds.y+1, dockableBounds.width-2, dockableBounds.height-2 );
	}
}


Now I’m not quite sure if we speak of the same thing, but I think not. I think your questions are better answered with:

  • The framework never paints directly on the screen. Java just does not support this in any easy way. And I really did not want to get into a native code hell :wink:
  • The framework sometimes opens a window below the mouse that shows a title or a screen capture of the dragged Dockable.

Let the following code run, is the behavior now what you intended? If yes, well you now know how to solve the issue.

        theme.setMovingImageFactory(new ScreencaptureMovingImageFactory(new Dimension(200, 200)));
        control.setTheme(new CEclipseTheme(control, theme));```

wow, it works:

http://code.google.com/p/docking-frames/source/browse/demo/trunk/docking-frames-examples/src/main/java/org/dockingframes/example/eclipse_theme/Main_3045.java

you must have an endless list of magic tricks hidden in your docking-frames :slight_smile:

thank you;

A few, yes :wink:

„Hidden“ is the right term. There was a time when everything was neatly collected in DockThemes. And then things somewhat got more complex…