aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Plugins in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Plugins in Eclipse" Watch "Plugins in Eclipse" New topic
Author

Plugins in Eclipse

Jim Anderson
Greenhorn

Joined: Apr 19, 2013
Posts: 15

I'm trying to use Graphics2D, and I need to add plugins to my basic Eclipse program. I've downloaded the plugins and saved them in my base "Eclipse/plugins" folder. But I cannot find them from Eclipse itself -- I get no "add plugins" option. What am I missing?

Thanks.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Hey Jim, I added this thread to the IDEs forum as well, hoping it gets more exposure with folks who look there.

Welcome to the Ranch


Steve
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

Graphics2D as in http://docs.oracle.com/javase/7/docs/api/java/awt/Graphics2D.html?
What plugin have you added and what does it do?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Jim Anderson
Greenhorn

Joined: Apr 19, 2013
Posts: 15

Maneesh: Thanks for responding. Yes, I'm trying to use Graphics2D. My Eclipse-JAVA code, incorporating Graphics2D elements, seems to compile. But no graphics are created. I figured that I'm missing something in Eclipse, so I downloaded the "Java2D for Eclipse" plugin from sourceforge.net/projects/holongate. I think the original JAVA code was written by "holongate" in the early 2000's. But I can't get Eclipse to recognize the plugin. Two questions: Do I need the plugin for Graphics2D; and How to I force plugins in Eclipse?

Jim Anderson
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

This is a bit confusing for me.
Usually Graphics/2D are used for custom painting on the screen (e.g. gradient painting) http://oreilly.com/catalog/java2d/chapter/ch04.html
Can you explain a bit more on what you mean by "But no graphics are created."
Please post some SSCCE with a brief note on what you are trying to achieve
Jim Anderson
Greenhorn

Joined: Apr 19, 2013
Posts: 15

Let me answer your "what are you trying to do" question. I want to write JAVA code (using Eclipse) to create "Gen Art" = abstract art generated by computer. I've had some success using Graphics 1D, but now I need more. It's not clear (to me) if the latest Eclipse JAVA download contains everything I need for Graphics2D. I seem to have a version of JDK1.7, not JDK 2.0.

My entire code is rather long. I tried to attach it, but got error messages because my files had .txt ot .java extensions. The fragment below shows where I expect Graphics2D to draw & fill an irregular figure. I've printed out the x_values[] & y_values[] vectors and they are filled with correct (double) values. But nothing gets drawn on the computer monitor. A subsequent problem: how to save the filled image to a file -- using buffers.

public void drawPath(Graphics g){
// zeroBackground(g);
Graphics2D g2d = (Graphics2D)g;
g2d.setColor(Color.black);
// Path2D.Double path = new Path2D.Double();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g2d.translate(25, 5);

GeneralPath path = new GeneralPath();

path.moveTo(x_values[0],y_values[0]);

for(kk=1;kk<total_points;kk++){
path.lineTo(x_values[kk],y_values[kk]);
// path.moveTo(x_values[kk],y_values[kk]);
// System.out.println("x="+x_values[kk]+";y="+y_values[kk]);
}
System.out.println("total_points="+total_points);
path.closePath();
g2d.fill(path);
}

public void paintComponent(Graphics g){
super.paintComponents(g);
setVisible(true);
// zeroBackground(g);
drawPath(g);
}

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Plugins in Eclipse