Jose Ariza

Ranch Hand
+ Follow
since Sep 16, 2017
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jose Ariza

Yes, I make them as source folder.
I have just solved it by putting my g4 file under some package instead of directly put them under the root.
1 year ago
I want to use antlr4 in a java project, and I use eclipse to develop. I put antlr4-complete.jar into build path.

first, I wrote a g4 file under my project root folder, then eclipse auto generate target/generate-sources/antlr4 to me. and I convert it to the source folder.
But when I want to use the class generated above, eclipse say I can't resolve the symbol, But I have already saw them in the folder....

BTW, I can test this in command line, and it's good. Could you help me?
1 year ago
yes, I did some search works, but without a clear answer yet. I'm going to do further searching later cause I have to do some work...
Thanks for replying me so much ( a nice forum). If I have any progress I will post my resolution to you.  
1 year ago
I checked API doc for mxConstants.STYLE_IMAGE, there's something like this

Defines the key for the image style. Possible values are any image URL, registered key in mxImageResources or short data URI as defined in mxImageBundle. The type of the value is String.

So the picture on your disk can't be a URL, while a picture on the Internet could.
So, you can load pic from Internet like this

Or, you can put your bezier png under your project, for example, new a folder(resource) in your project, and put the picture there.

If you still want to load a picture from your disk, it's should be a URI path, like this,

see answers in this web.
1 year ago

Piet Souris wrote:It might be creating a genuine SVG, this way, or it might be generating a bitmap. I don't know that library, but I will take a look at it. Keep us informed aout your findings!

OK! I'm glad to offer you a simple SSCCE. btw, I found Batik or JFreeSVG could convert png to SVG.
1 year ago

Stephan van Hulst wrote:I see that the JGraphX library has a com.mxgraph.shape package. Can you compose your symbols from shapes in that package?

I apply the image to a mxCell in JGraphx by style. This means I should define the style that mxCell used. It's Something like this

So,the STYLE_SHAPE is image. I don't know Can I compose a image by shape. And how to store the new image in project.
So, I'll have a try.
Thanks for the reply.
1 year ago
Simply the third way won't achieve, cause I don't have multiple icons  
But I will try the other two, Especially SVG way. Thank you very much!!!
1 year ago

Piet Souris wrote:What kind of images are you working with? For normal pictures from a camera, enlargement, certainly if not too extreme, gives excellent results (see the standard Java classes like BufferedImageOp and its variants, in combination with RenderingHints).

If you have such an image, then SVG has two options: either the BitMap is simply incorporated in the SVG-file, in which case enlargement has the same problems, or the BitMap is converted into geometric figures like Lines and Bezier curves. Inkscape has such a facility, but I don't know how well that works.

If you yourself create images by drawing straight lines and such into, say, a BufferedImage, then you might as well create a Path, that works similar to SVG and scales without blurring. See the API.

Thanks for answering.
Actually, I stored a png image under resource folder of the project, and I used it with a third party library called JGraphx, like this
The pic is 16 * 16 pixels, so it got blurring when I zoom the graph(Panel). So in your way, I should convert the pic into BufferedImage first by java, and reuse it. Am I understand right?
1 year ago

Campbell Ritchie wrote:Since that is an old post, the original poster might no longer be around, and you might not get a reply.

Thanks for attention. Btw do you know anything about how to use SVG image in Swing?
1 year ago
I display an image(.png) in a container, actually in a JGraphx library's component called mxCell. But when I zoom in the image, it vagued. How to avoid this?
I did search and I found Batik may help because it uses SVG. So How should I Display a SVG format image in a container? And zoom won't make it blur.
1 year ago
So have you found out one?
1 year ago
I'm using JGraphX, and I want to draw a line on the graph and I find there is mxLine class, so I new a mxLine but I don't know how to add it on the graph. Here's my snippet:
1 year ago

Rob Spoor wrote:If you get a String that means that the user object is a String. There are no transformations done between setting the value and getting it again.

Yes, Thanks. I solved this. If I edit the tree, the node's object is changed to the String I entered.
1 year ago
I solved this. If I edit the tree, the node's object is changed to the String I entered.
1 year ago
I implement a Jtree, and its node is initialized by "Event" object. and I made Jtree editable, and add a ModelListener to the model of this tree. But, When I use getUserObject() in this listener, the node only return me a String instead of the "Event" object. Why?
Here's my code:

and this is Event class:
1 year ago