Re: [JAVA2D] Canvas vs. JComponent for drawing (again)

2006-05-26 Thread Dmitri Trembovetski
  Hi Jonathan,

  yes, in Swing applications JComponent should be used, and not
  Canvas. Canvas is a heavyweight component and using it may interfere
  with Swing's repainting.

  Thanks,
Dmitri

On Fri, May 26, 2006 at 12:28:57AM -0400, Jonathan Mast wrote:
  [I sent this the first day I signed up for this list, so I'm thinking a snafu
  might have kept it from posting, or AOL might have blocked any replies at
  first, anyways here it is:]
 
  I'm reasonably proficient in Swing but as I've began programming in java2D,
  I'm puzzled by all the usages of java.awt.Canvas I've seen as the GUI 
  component
  in which the custom graphics are drawn in.  So far, I've used JComponent
  subclasses for this purpose.  Is there a reason I should use Canvas instead? 
   I
  presume it is heavyweight, whereas JComponent is lightweight, which I thought
  was the preferred way of implementing GUI and graphics in java.
 
 
  thanks in advance,
  [EMAIL PROTECTED]
 
 
  P.S. Do me a big favor and even if you don't have an answer, just reply
  anyway to confirm that this message got thru. thanks again.
 
  ===
  To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
  of the message signoff JAVA2D-INTEREST.  For general help, send email to
  [EMAIL PROTECTED] and include in the body of the message help.

===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message signoff JAVA2D-INTEREST.  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message help.


Re: [JAVA2D] Black and White printing

2006-05-26 Thread Phil Race

Perhaps you could create a BufferedImage.TYPE_BYTE_BINARY with a 2 color
IndexColorModel
and have all the printing go into there. Then all rendering will have to
be one of those two colours
which I assume you would select as BW.

The drawbacks to this are that to get printer resolution graphics
(something you also
were seeing problems with already) that BufferedImage will need to be
big and you
will have to scale it appropriately and the resulting spool file will
also be huge.
Another drawback is that it may not look very pretty.

In any case I don't see a way to do this via the printing APIs.

-phil.

[EMAIL PROTECTED] wrote:


Phil,

I'm still puzzled.  It isn't clear how to accomplish what I want.  If I was in 
a color lookup world I would do something like:  set 0 - white and colors 1-256 
to black.  The problem with monochrome printing is the user has a yellow line 
drawn and wants to print it on a black and white printer.  If I use grayscale 
it comes out as a faint line on the paper.  When it copys this or puts it on a 
viewfoil it is very faint and noone can read it.  So the need for Black and 
White.
[Message sent by forum member 'diverdad' (diverdad)]

http://forums.java.net/jive/thread.jspa?messageID=116324

===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message signoff JAVA2D-INTEREST.  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message help.




===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message signoff JAVA2D-INTEREST.  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message help.


Re: [JAVA2D] A few simple Java 2D questions ...

2006-05-26 Thread java2d
Hi Jim,

By 'sub-pixel' are you referring to the sub-pixels in LCD displays, for example?

Does this then not apply to CRT monitors?

Thanks,

D.
[Message sent by forum member 'dodger' (dodger)]

http://forums.java.net/jive/thread.jspa?messageID=116601

===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message signoff JAVA2D-INTEREST.  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message help.


[JAVA2D] Repaint flicker when mixing swing heavyweight

2006-05-26 Thread Mark McKay

I'm writing an application that uses JOGL, and so necessarily contains a
heavyweight component that extends Canvas.  However, most of the
application uses Swing, including a component of my own design that
extends JComponent and has a complex repaint routine.  While my
component works properly, when I move the mouse over it when the Canvas
is visible, it flickers rapidly between it's normal display and a blank
rectangle of the clear color.

What can I do to stabilize my component so it doesn't flicker?

Mark McKay

===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message signoff JAVA2D-INTEREST.  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message help.