Skip to main content



      Home
Home » Eclipse Projects » GEF » Palette Background Color
Palette Background Color [message #227210] Thu, 30 November 2006 09:28 Go to next message
Eclipse UserFriend
Hi - can anyone tell me how I can go about changing the background color of
my palette (interested in a white background) - thanks, Barry.
Re: Palette Background Color [message #227237 is a reply to message #227210] Thu, 30 November 2006 15:04 Go to previous messageGo to next message
Eclipse UserFriend
Hi Barry,

To me this seems not an easy thing to do, it's straight-forward, but
requires a lot of work. The colors for palette entries are hard coded in
palette edit parts classes under
org.eclipse.gef.internal.ui.palette.editparts. This means they are not
supposed to be used by clients. Hence you'll have to extend
PaletteEditPartFactory to provide your own edit parts and create them
based on the edit parts in the GEF's internal package above. In your edit
parts you'll be able to provide custom colors for the edit parts' figures.
The customized edit part factory can be plugged to the PaletteViewer. This
could be done in PaletteViewerProvider#configurePaletteViewer().
You can try this, unless someone has a better idea of how to implement
custom colours for palette.

Cheers,
Alex
Re: Palette Background Color [message #227256 is a reply to message #227237] Thu, 30 November 2006 16:31 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alex,

That does seem like alot of work. If all else fails, I will certainly give
it a try - Thanks alot for the explanation. Does anyone else know of a
simpler solution?
thanks - Barry

"Alex Boyko" <aboyko@ca.ibm.com> wrote in message
news:8400d55158447be2423093f3f7b40067$1@www.eclipse.org...
> Hi Barry,
>
> To me this seems not an easy thing to do, it's straight-forward, but
> requires a lot of work. The colors for palette entries are hard coded in
> palette edit parts classes under
> org.eclipse.gef.internal.ui.palette.editparts. This means they are not
> supposed to be used by clients. Hence you'll have to extend
> PaletteEditPartFactory to provide your own edit parts and create them
> based on the edit parts in the GEF's internal package above. In your edit
> parts you'll be able to provide custom colors for the edit parts' figures.
> The customized edit part factory can be plugged to the PaletteViewer. This
> could be done in PaletteViewerProvider#configurePaletteViewer().
> You can try this, unless someone has a better idea of how to implement
> custom colours for palette.
>
> Cheers,
> Alex
>
Re: Palette Background Color [message #228413 is a reply to message #227210] Wed, 20 December 2006 12:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter.schoell.hwb-ag.com

Hi,

thats easy....

In DiagramEditPart:

protected IFigure createFigure() {

ConnectionLayer connLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
connLayer.setConnectionRouter(new ManhattanConnectionRouter());

return new DiagramFigure();
}

// use your own Figure for the Diagram

public class DiagramFigure extends FreeformLayer {

public DiagramFigure() {

setBorder(new MarginBorder(3));
setLayoutManager(new FreeformLayout());
setBackgroundColor(ColorConstants.lightGray);
// Create the static router for the connection layer
}

/** Paint this figure. */
public void paintFigure(Graphics graphics) {
graphics.setAntialias(SWT.ON);

graphics.setForegroundColor(ColorConstants.lightGray);

graphics.setBackgroundColor(ColorConstants.white);
graphics.fillGradient(getBounds(), true);

}
}

Hope this helps,
peter
Re: Palette Background Color [message #228422 is a reply to message #227210] Wed, 20 December 2006 12:46 Go to previous message
Eclipse UserFriend
Originally posted by: peter.schoell.hwb-ag.com

Hi,

ups, ok, this was for the Diagram Background....

sorry...

peter
Previous Topic:GEF Shapes-RCP show outline and property views
Next Topic:GEF Shapes-RCP example and Property View
Goto Forum:
  


Current Time: Tue May 13 06:22:23 EDT 2025

Powered by FUDForum. Page generated in 0.04073 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top