In draw2d,How can I draw a figure without having any border? How to implements the CustomBorder for rectangles to remove the border? I know if we implement a class which extends Border, and in the paint method what should I do to remove the border?
rectangle without border
1.6k Views Asked by user414967 At
2
There are 2 best solutions below
1
Peter Bagyinszki
On
You can disable the border with figure.setBorder(null); or you can put it in the constructor:
public static class BorderlessFigure extends Figure {
public BorderlessFigure() {
ToolbarLayout layout = new ToolbarLayout();
setLayoutManager(layout);
setBorder(null);
add(new Label("test"));
}
}
If you want a Border that does not paint anything you can extend org.eclipse.draw2d.AbstractBorder:
public class NoBorderBorder extends AbstractBorder {
@Override
public void paint(IFigure f, Graphics g, Insets i) { }
@Override
public Insets getInsets(IFigure f) {
return new Insets(0);
}
}
I don't know why would you do that though.
Related Questions in ECLIPSE-PLUGIN
- Problems setting up product with plugins using AspectJ on Eclipse version 2024-03
- How to make my own custom checkstyle checks available in eclipse checkstyle plug-in
- Is it possible to set the default initial startup size of an Eclipse RCP application?
- How can I download the raw metamodels from my EMF registry?
- Eclipse plug in not discovered from the site where i uploaded my 'update site project' directory
- org.apache.httpcomponents.httpclient thows Unresolved requirement error when my eclipse RCP is lauched
- Creating an Eclipse RCP application installer using InstallShield
- How to implement custom hover for the IMarker in Eclipse plugin development?
- Exclude specific jar from p2 repo in my eclipse plugin build
- How to Resolve Conflicting Lifecycle Mapping in Eclipse for Tycho and PDE
- Link a Acceleo query to a Java generic function
- Eclipse is using https instead of http
- Description Resource Path Location Type make: *** [main.o] Error -1073741502 taha C/C++ Problem
- How to programmatically remove the "Detach" context menu item from an Eclipse RCP view toolbar?
- remote debugging application code(eclipse-test-plugin) in eclipse IDE via maven build not working
Related Questions in SWT
- SWT Popup Context Menu width issue
- Is there a way to check the Mac version using Platform.OS on Windows?
- SWT button has border by default
- SWT Progress Bar
- Java 16 app : ignore windows zoom/scaling
- How to programmatically remove the "Detach" context menu item from an Eclipse RCP view toolbar?
- Gradient color for cells in NatTable using Style() and not CSS
- How can I run Eclipse SWT applications in a browser as WebAssembly?
- SWT.SetData listener not listening when calling table.redraw() in Java SWT project
- How to change the size of Checkbox within the Virtual Table column in eclipse SWT?
- How to add Checkbox to table column Header in SWT Java?
- Unreliable Clipboard Event Handling in Java Program
- SWT browser in Eclipse unable to access localStorage
- Underline below the name of CTab
- Java, SWT how to make RowLayout working within a ScrolledCompositite?
Related Questions in ECLIPSE-RCP
- SWT Popup Context Menu width issue
- Problems setting up product with plugins using AspectJ on Eclipse version 2024-03
- Eclipse RCP export: The signature is invalid for current content
- Is it possible to set the default initial startup size of an Eclipse RCP application?
- org.apache.httpcomponents.httpclient thows Unresolved requirement error when my eclipse RCP is lauched
- Creating an Eclipse RCP application installer using InstallShield
- Implementation Issues with Log4j in Eclipse EMF RCP Using Java 17 and not OSG
- Using System.Logger and Log4j2 inside Eclipse RCP application
- How to Resolve Conflicting Lifecycle Mapping in Eclipse for Tycho and PDE
- Add version information to product of RCP application
- How to programmatically remove the "Detach" context menu item from an Eclipse RCP view toolbar?
- Unknown OSGi execution environment: 'JavaSE-21'
- remote debugging application code(eclipse-test-plugin) in eclipse IDE via maven build not working
- Gradient color for cells in NatTable using Style() and not CSS
- First MPart with first part of input file and Second MPart with second part of input file
Related Questions in DRAW2D
- Draw2d JS limited connection of ports
- Extremely large SVG file when using Golang Draw2d
- can not load javascript drow2d canvas with manuall extends cods
- Draw2D alignement in react, or Draw2D boxing
- Menu position appearing way off when the canvas it not positionned as top element on the page
- installation of draw2d latest version on angular 10
- How to always show Sirius Label in foreground
- Maxima encountered a Lisp error: I do not understand what the problem is
- Save & Restore Diagrams In Draw2D.js Via JSON
- Unable to use draw2d in reactjs - Cannot read property 'x' of undefined
- How to get port, connection details
- Keep canvas selection when a click is done outside of the canvas
- Is there a way to have an iframe element on a Draw2D powered canvas?
- Drag & Drop child node in Draw2d Custom Layout/Figure
- How to add Combo Feature in a ContainerShape Graphiti
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Figures don't have a border unless you explicitly set one by calling
setBorder(..). If you just want a blank figure that doesn't draw anything, thennew Figure()will give you just that. There's no need to implement any custom borders or figures. If you are using aRectanglethen that's exactly what you will get: a rectangle; which is what you probably confused for a border.