graphic

Java Swing show progress in pie form

谁说胖子不能爱 提交于 2019-12-01 00:41:06
I want to show a progress in pie format. Can anyone help? I have the data to show, but how to show it in this format. Something like progress shown in Google Chrome when we download files. Based on the links provided by @trashgod, here is one way you can achieve a "Pie" effect. This only handles the indeterminate progress bar, but it would be very easy to add the "determinate" behaviour. import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt

How to display tree hierarchy in Java?

巧了我就是萌 提交于 2019-11-30 19:21:32
I have a table in a database named "Process" This process table has 3 fields: process_id process_name process_parent_id Now I want to display this parent child hierarchy in Graphical format. So could you please suggest me the following: Q1. Which data structure would be better to use so as to get data from the database and store in that data structure? Q2. How to display that tree (process hierarchy) in graphical format? EDIT: I want the graphical format something like this: Kentaree Swing has a built-in control for displaying data in a Tree format called JTree . It also provides a data model

python 3D visualization and graphics [closed]

寵の児 提交于 2019-11-30 12:35:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am looking for Python compatible 3D graphics. Mostly I would like to be able to draw lines and view them in 3D. I literally have no experience in this area and am looking for knowledge and tutorials. I learn programming best by experimentation. So which packages do I need to do 3-D graphics? I really enjoy

python 3D visualization and graphics [closed]

試著忘記壹切 提交于 2019-11-30 04:54:49
I am looking for Python compatible 3D graphics. Mostly I would like to be able to draw lines and view them in 3D. I literally have no experience in this area and am looking for knowledge and tutorials. I learn programming best by experimentation. So which packages do I need to do 3-D graphics? I really enjoy using emacs, so if you have those suggestions as well that would be awesome! In summary: Which packages do I need for 3D graphics in python. Note that I use Ubuntu 12.04 LTS and emacs 24.3 EDIT My answer below is for those who are interested in realtime graphics. If you just need to draw a

How to display tree hierarchy in Java?

自古美人都是妖i 提交于 2019-11-30 04:28:43
问题 I have a table in a database named "Process" This process table has 3 fields: process_id process_name process_parent_id Now I want to display this parent child hierarchy in Graphical format. So could you please suggest me the following: Q1. Which data structure would be better to use so as to get data from the database and store in that data structure? Q2. How to display that tree (process hierarchy) in graphical format? EDIT: I want the graphical format something like this: 回答1: Swing has a

writing png plots into a pdf file in R

蹲街弑〆低调 提交于 2019-11-30 01:51:54
问题 I have to create a bunch of graphs with a lot of data points. So far, I've been doing this by plotting all of them into one pdf -file: pdf("testgraph.pdf") par(mfrow=c(3,3)) for (i in 2:length(names(mtcars))){ plot(mtcars[,1], mtcars[,i]) } dev.off() However, with a lot of data points the pdf file becomes too large. As I'm not interested in outstanding quality, I don't care if my plots are vector graphics or not. So I thought of creating the plots as png and subsequently inserting them into a

iPhone iOS Generate star, sunburst or polygon UIBezierPath programmatically

守給你的承諾、 提交于 2019-11-29 14:42:28
问题 I'm looking for a way to programmatically create stars, sunburst, and other "spiky" effects using UIBezierPath. UIBezierPath *sunbeamsPath = [UIBezierPath bezierPath]; [sunbeamsPath moveToPoint: CGPointMake(x, y)]; Are there any algorithms that can generate points for sunburst like shapes programmatically, without paths overlapping? I'm also interested in an irregular shape sunburst like the one below: I would imagine that such algorithm would take a certain number of rays, then roughly

How can I automatically determine whether an image file depicts a photo or a 'graphic'?

[亡魂溺海] 提交于 2019-11-29 05:17:12
How can I automatically determine whether an image file depicts a photo or a 'graphic'? For example using Imagemagick? I am somewhat at the limits of my knowledge here, but I read a paper and have worked out a way to calculate image entropy with ImageMagick - some clever person might like to check it! #!/bin/bash image=$1 # Get number of pixels in image px=$(convert -format "%w*%h\n" "$image" info:|bc) # Calculate entropy # See this paper www1.idc.ac.il/toky/imageProc-10/Lectures/04_histogram_10.ppt convert "$image" -colorspace gray -depth 8 -format "%c" histogram:info:- | \ awk -F: -v px=$px

Drawing dashed line in java

末鹿安然 提交于 2019-11-29 02:59:25
My problem is that I want to draw a dashed line in a panel, I'm able to do it but it draw my border in dashed line as well, which is oh my god! Can someone please explain why? I'm using paintComponent to draw and draw straight to the panel this is the code to draw dashed line: public void drawDashedLine(Graphics g, int x1, int y1, int x2, int y2){ Graphics2D g2d = (Graphics2D) g; //float dash[] = {10.0f}; Stroke dashed = new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[]{9}, 0); g2d.setStroke(dashed); g2d.drawLine(x1, y1, x2, y2); } You're modifying the Graphics

save an image as a bitmap without losing quality

梦想与她 提交于 2019-11-28 11:43:58
I had a problem of printing quality and I described it in this link : enter link description here I tried many different solutions that helped other guys with similar prob but they don't work for me because I have a new prob of saving image as bitmap(with low quality) finally I decided to ask my current question , because as u see in above link , my prob starts after saving the image in system(96dpi) and restoring it . but I have no way so I'm looking for a way that make it possible to save an image (that has pixels drawn from a graphic) without losing quality. thanx in advance While 96 dpi is