Algorithm-VSM
view release on metacpan or search on metacpan
examples/corpus/RenderGraphics.java view on Meta::CPAN
f.setBackground(bg); //(D)
f.setForeground(fg); //(E)
Container contentPane = f.getContentPane();
contentPane.setLayout( new GridLayout( 0, 3 ) );
//polyline:
contentPane.add( new JPanel() {
public void paintComponent(Graphics g) {
super.paintComponent(g); //clears the background
width = getWidth();
height = getHeight();
int stringY = height - 10;
rectWidth = width - 20;
rectHeight = stringY - maxCharHeight - 10;
int x2Points[] =
{10, 10+rectWidth, 10, 10+rectWidth};
int y2Points[] =
{10, 10+rectHeight, 10+rectHeight, 10};
g.drawPolyline(x2Points,
examples/corpus/RotatingRect.java view on Meta::CPAN
}
});
}
//important for panel sizing:
public Dimension getPreferredSize() {
return preferredSize;
}
public void paintComponent(Graphics g) {
super.paintComponent(g); //paint background
int xFromCenter = 0;
int yFromCenter = 0;
int rectOriginX = halfWindowWidth - rectWidth / 2;
int rectOriginY = halfWindowHeight - rectHeight / 2;
g2d = (Graphics2D) g;
if ( point != null ) {
xFromCenter = point.x - halfWindowWidth;
yFromCenter = point.y - halfWindowHeight;
theta = Math.atan2( (double) yFromCenter,
examples/corpus_with_java_and_cpp/RenderGraphics.java view on Meta::CPAN
f.setBackground(bg); //(D)
f.setForeground(fg); //(E)
Container contentPane = f.getContentPane();
contentPane.setLayout( new GridLayout( 0, 3 ) );
//polyline:
contentPane.add( new JPanel() {
public void paintComponent(Graphics g) {
super.paintComponent(g); //clears the background
width = getWidth();
height = getHeight();
int stringY = height - 10;
rectWidth = width - 20;
rectHeight = stringY - maxCharHeight - 10;
int x2Points[] =
{10, 10+rectWidth, 10, 10+rectWidth};
int y2Points[] =
{10, 10+rectHeight, 10+rectHeight, 10};
g.drawPolyline(x2Points,
examples/corpus_with_java_and_cpp/RotatingRect.java view on Meta::CPAN
}
});
}
//important for panel sizing:
public Dimension getPreferredSize() {
return preferredSize;
}
public void paintComponent(Graphics g) {
super.paintComponent(g); //paint background
int xFromCenter = 0;
int yFromCenter = 0;
int rectOriginX = halfWindowWidth - rectWidth / 2;
int rectOriginY = halfWindowHeight - rectHeight / 2;
g2d = (Graphics2D) g;
if ( point != null ) {
xFromCenter = point.x - halfWindowWidth;
yFromCenter = point.y - halfWindowHeight;
theta = Math.atan2( (double) yFromCenter,
( run in 3.469 seconds using v1.01-cache-2.11-cpan-0d23b851a93 )