Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Java
 QCChart2D for Java
 ChartView setBackground() cancels border

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
rixmith Posted - 27 Sep 2010 : 15:02:57
Is it possible to set a Background for a ChartView object and to conserve the ChartView border? It appears that setting the ChartView background prevents the Chartview border from being painted.

I'm using the constructor Background(timeCoords, bgtype, color). I tried both background types and neither results in the border being painted.



Rick
5   L A T E S T    R E P L I E S    (Newest First)
quinncurtis Posted - 28 Sep 2010 : 09:33:32
Given the border in your example is a simple line border, you can just use the built in border of the Background class, as previously mentioned, setBorderEnable(true). That is, once we update the software to include the fix for the border line width bug. That will take place before the end of next month.
rixmith Posted - 28 Sep 2010 : 07:54:49
I just wanted to confirm thst I had not missed an option or setting that would have gotten the job without the extra JPanel. Thank you for the quick response.

Rick
quinncurtis Posted - 27 Sep 2010 : 22:32:41
In that case, yes the ChartView will always hide the border. We have no provision in the software to take into account the border of the subclassed JPanel. The software has never had that feature. Your only alternative is to create JPanel, add a border to it, then place the ChartView as a child of the JPanel, positioned inside the border.
rixmith Posted - 27 Sep 2010 : 19:44:37
To be clear, let me show you a simple test that illustrates the
problem. Run the code below and the ChartView border is drawn correctly.
Uncomment the line that adds the background to the ChartView and
run again: the border is not painted.
The println() at the end of the code confirms that the border is set correctly.

public static void main(String[] args) {
JFrame f = new JFrame("Test ChartView Border");
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
f.setSize(300,300);
TimeCoordinates timeCoords = new TimeCoordinates();

ChartView cv = new ChartView();
Background background = new Background( timeCoords, ChartConstants.PLOT_BACKGROUND,
new Color(6,255,77));
// cv.addChartObject(background); //***** uncomment this line
cv.setBorder(BorderFactory.createLineBorder(Color.red, 3));
f.add(cv);
f.setVisible(true);
System.out.println("Thickness >> " + ((LineBorder)cv.getBorder()).getThickness());


}

Rick
quinncurtis Posted - 27 Sep 2010 : 18:13:35
What is the setBackground reference in your topic?

Are you referring to the Background setBorderEnable method of drawing the border ?

We see that there is a bug in this. The line thickness of the border is not set when it is drawn, so it stays at the default value of 1 and can barely be seen. It is a simple fix. If you have the source we can tell you what to do. Otherwise we will put it in an update next month.

Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07