JavaFX 2.0 :: Panel Effect - Rotation Along Its Y Axis

Dec 14, 2014

I have a UI widget, like a table view for example, displaying real-time data. This table can be configured - so it has many properties. The way I would like to do so, is to have a small 'configure button', once clicked, would rotate the entire table along its y axis, and display another panel with checkboxes etc... So effectively, the hidden properties panel is revealed by rotation.

View Replies


ADVERTISEMENT

JavaFX 2.0 :: Image Overlay Rotation Interpolation Error

Jun 12, 2015

I'd like to draw an overlay on an image. The overlay is also an image with a black background and a white foreground. Now the white pixels should be drawn on the image in red. This is possible with the code I posted below. However, the problem arises when rotating the stencil (overlay). I get some interpolation errors from the rotation on the boundaries. I tried to clip them with setClip(), but this turns the background from transparent to white. How to remove those spots? Or maybe a completely other idea of achieving an overlay on the image? I'm aware of the pixelreader and iterating through the stencils pixels and draw the respective pixels as rectangles on a Canvas' graphicContext. However, this was extremely slow, compared to the code I posted below (although it doesn't work with rotations).

Here I surrounded the errors:
 
The image:
 
The stencil:
 
And here is the code:
 
import javafx.application.Application; 
import javafx.geometry.Insets;
import javafx.scene.*;
import javafx.scene.effect.BlendMode;
import javafx.scene.image.*;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;

[Code] .....

View Replies View Related

JavaFX 2.0 :: Chart Axis Changing Color

Mar 20, 2015

I'm struggling to change the colour of the X and Y axis. I can change the colour of the ticks and the tick labels in CSS... But not the axis themselves.

View Replies View Related

JavaFX 2.0 :: BarChart Axis Tick-labels Missing With JDK1.8

Jul 10, 2014

Currently I try to integrate a JavaFX BarChart into my existing Java application. Therefore I need a BufferedImage of my BarChart, so that I can render that snapshot on a Graphics instance.
 
I adapted the existing BarChartSample.java (Chart Sample | JavaFX Tutorials and Documentation) and removed all animations. The code itselfs works fine but I identified one problem -> my TickLabels are missing
 
The TickLabels are visible If I use JDK 1.7u51 but if I change to JDK 1.8u05.... than the stlye of my BarChart will be changed and my tick labels are not visible.
 
Did I missed something or is that a bug?
 
using JDK 1.7u51
[URL] .....
 
using JDK 1.8u05
[URL] .....
 
My adapted code is the following:

package barchartsample;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

[Code] .....

View Replies View Related

JavaFX 2.0 :: 3D Sphere To Represent Each Single Point - Rotation Lagging With Large Number Of Points

May 22, 2014

We are doing a visualisation tool for point cloud research project. We use 3d sphere to represent each single point and when we have large number of points to display (~40,000), the rotation becomes very lagging.
 
What we have tried:

set JVM flag -Djavafx.animation.fullspeed=true, this worked a bit, but not significant.set JVM flag -Djavafx.autoproxy.disable=true, this did not work.

set Cache to true and CacheHint to Cache.SPEED, this did not make much difference.create another thread to do the rotation, and sync back after calculation, this did not work neither.

View Replies View Related

Print Table (array) Where Have X Axis And Y Axis?

Apr 12, 2015

I want to print a table (array) where I have an X axis and a Y axis. 16x11. My code is as follows:

int Windchill [] [] = new int [16][11];
{
{60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5, 0, -5, -10, -15} //X
{0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50} //Y
};

The code doesn't work even though it's similar to

int Windchill [][] =
{
{60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5, 0, -5, -10, -15}, //X
{0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50}, //Y
};

if I remember correctly, the 2 are correct just written in different ways.

and I want it to print like this

{60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5, 0, -5, -10, -15},
{ 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0,
5, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0,
10, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0,
20, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0,
25, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0,
30, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0,
35, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0,
40, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0,
45, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0,
50, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0,}

where 0 is null (for now). I want to fill those in with a formula later, but I don't hardcoding them one by one is the most "efficient" way to do it

View Replies View Related

JavaFX 2.0 :: How To Avoid Scaled ScrollPane Content Panel From Being Centered

Nov 19, 2014

I want to create a ScrollPane where I can scale the contents. Think of a simple drawing program that allows you to zoom in and zoom out.
 
If I create a ScrollPane in SceneBuilder and then drop a couple of Circles into the AnchorPane all looks good.
 
If I then set a scale of 0.5 for the AnchorPane Scale X and Scale Y the AnchorPane gets scaled about its centre leaving space between the left and top edge of the AnchorPane and the left and top edge of the enclosing ScrollPane.
 
The only way to get the AnchorPane so that it aligns with the top left of the ScrollPane seems to be to add a negative amount to Translate X and Translate Y.
 
In my application I would like the user to be able to adjust the zoom (Scale) continually and also the size of the AnchorPane must be allowed to change as the user add/deletes/edits content.
 
Does this mean I have to continually monitor the AnchorPane properties and set compensating Translate X and Translate Y values each time? Or is there an easier way to achieve what I want?

<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.paint.*?>
<?import javafx.scene.effect.*?>
<?import javafx.scene.*?>
<?import javafx.scene.shape.*?>

[Code] ....

View Replies View Related

Swing/AWT/SWT :: When Click On Button From Bottom Panel Top Panel Need To Be Redrawn

Apr 1, 2014

When i click on the button from bottom panel, top panel need to be redrawn. But redrawing is not happening. It happens only when resizing the applet.

public class Graphics_Chart(){
public init(){
JScrollPane topPane = new JScrollPane(new ImagePanel2());
topPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
topPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);

[code]...

View Replies View Related

Image Rotation And Alignment

Mar 22, 2014

My problem in order to align and and rotation for image?

View Replies View Related

Graphics Rotation In Swing

Feb 3, 2014

How to rotate a shape in Swing? The only thing I found was something involving this, but I have not seen something like this before:

Java Code : Graphics2D g2d = (Graphics2D)g; mh_sh_highlight_all('java');

I see this is an object reference, but what is on the right side? Does not seem like a method, as it would not equal a method nor would the parentheses be on the left. Why are parentheses there? Disregarding the above code, I would like to know how to rotate without Graphics 2d

Also, with G2D you it will not allow for setting x coords

View Replies View Related

2D Circle Texture Rotation?

Jan 11, 2015

So I have this randomly generated set of tiles that is wrapped in a circle and I'm not really sure how to scroll it around the circle. Basically it's a side-view planet that is in 2D and needs to be wrapped and moving at a controllable rate to give the illusion of planet rotation. What to do to the x and y to make it scroll around. I want every tile except the water tiles to move from left to right and then wrap around the circle. Here's what a planet looks like: [URL] ....

Java Code:

for (int x = 0; x < planet1.length; x++)
{
for (int y = 0; y < planet1[0].length; y++)
{
if (planet1[x][y] == 1 || planet1[x][y] == 2)
{
g.drawImage(water, x * 32, y * 32);

[Code] ....

View Replies View Related

Swing/AWT/SWT :: AffineTransform - Rotation Is Being Ignored When Set Transform

May 31, 2014

I'm experimenting with AffineTransform, Basically I've created just a simple test GUI to see how the code works and all that. Anyway, there are two buttons which turn an image left and right and a third button with moves the image to the right (East). When you first run the program the image is facing down (South). Now to turn left or right I'm using an Affine Transform and the rotate method. That works fine. The issue is when I move the image to the right, it ignore whatever rotation I previously I made (from turn left and right buttons). Therefore when I click to move the image, it faces down again even if it was facing left or up or right before I moved it. It will always be facing down. How do I get it to keep the rotation and just move? Btw I'm using the setTranslate method to move the image.

Below is my code.

Images.java
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
import javax.imageio.ImageIO;
public class Images {
static BufferedImage Icon, Rover;

[Code] ....

View Replies View Related

Effect Of Hiding In Polymorphism

Aug 25, 2014

I have difficulty understanding the following behaviour.

class A {
public String string = "a";
public String toString() {
return string;
}
}

class B extends A {

[code]...

The output of the program is 'c'. This is expexted behaviour. But if class B is changed as follows,

class B extends A {
public String string = "b";
}

Now the program prints 'a' instead of 'c'. Why the statement: b.string = "c"; is not taken into account?

View Replies View Related

JLabel With Marquee Effect

Jan 13, 2015

I want a JLabel with scrolling text as marquee effect...

View Replies View Related

Make A Text Blinking Effect

Mar 2, 2014

In carrying out my little game I made a panel "Winner" in which I have two JButton plus I would like to add a blinking text to indicate the victory of the player("You win!"). Currently this text is static, designed by the function drawImage. How can I make it "flashing" maybe alternating the vision of the text (which I present in two different colors)?

View Replies View Related

Effect Of Perm Gen Memory On CPU Utilization

Jul 3, 2014

I am working on a game project. Whenever we are starting our game application in production, it works perfectly around 3 days after 3 days, CPU utilization is increasing upto around 95% to 99% and application stops to respond. Before 6 days, I started application again and we doubled our Perm Gen memory size. The same problem happened but it happened after 6 days.

Now, i am not able to relate CUP utilization to Perm Gen memory. Is Perm Gen memory effect CPU utilization?

View Replies View Related

SetRGB Has No Effect On Alpha Bits

May 24, 2014

I am using something a kin to this:

for (int w=0;w<bi.getWidth();w++) {
for (int h=0;h<bi.getHeight();h++) {
int color = bi.getRGB(w, h);
color = color << 5;
bi.setRGB(w, h, color);
}
}

I am using a solid green image so

11111111000000001111111100000000

I just wanted to see how it looked so bumped it over 5 places (obviously changing the color). To my surprise, there was no added transparency. I mean moving it to the left would make the alpha:

11100000

I am thinking that setRGB() doesn't effect alpha. Is this accurate?Tested it and in fact setRGB has no effect on the alpha bits. So now the question is how can I gain access to them. I am going to look into the writable Raster API. Perhaps, I can also use a modified awt to access directly OS data.

View Replies View Related

Swing/AWT/SWT :: 2D Spaceship Game - Image Rotation And Position

Aug 29, 2014

I'm attempting to create a 2D spaceship game from scratch. My problem is that I feel like the way Im rotating images is awkward and just wrong. I believe what I'm doing in the following code is loading an image into a JPanel and rotating the image and moving the JPanel.

The code is unrefined and only partial, but it show how I am manipulating images.

import java.util.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.geom.AffineTransform;
import javax.swing.*;
import java.lang.Math.*;
import java.io.*;
import javax.imageio.*;

[Code] .....

What seems so awkward is that I have to create a new JPanel for every image, I would think there is a better way but I don't know. I have tried to get one image on top of an other with the JPanels to no avail. That said I haven't put much time into trying to get that to work. I want to know if I should continue my attempt with JPanels or to pursue a different method.

View Replies View Related

JSP :: Unable To Display Details In Lightbox Effect

Dec 3, 2014

I have one jsp page in which I have listed some service records fetched from Database. I have made one of the column, for eg. Service ID to be link, which should display all the details of that service when clicked. I want those details to be displayed in lightbox. I tried doing it but when any service ID link is clicked, it displays same(First Service in record) service details.How do I pass reference of that current service to lighbox effect.

View Replies View Related

Most Efficient Way To Store Color Effect Methods To Be Used

Oct 18, 2014

This isn't solely related to java.awt.Color, it's more of a question on how to store methods or redirections to use methods on any value passed in. To explain my question I'll describe a scenario:

ClassA is an instanstiatable class

ClassA has an instance of ClassB called cB

ClassA has methods of affecting cB

ClassD is also an instanstiatable class

ClassD has an Array[x][y] of instances of ClassA

I want to create a ClassE which I would initiate it with references to ClassA's methods or their actual methods and then I can use ClassE to easily transform ClassD's instances of ClassA by the same methods.

What I'm actually doing:

I made a class called GameColor, it has methods like changeHue, setRed, setHue, changeBrightness, setSaturation etc, these methods affect an instance of java.awt.Color in the GameColor class instances, so like they can change the hue or set it with changeHue or setHue etc...

Now I want to do something like perform a single method on a whole BufferedImage, on each of it's pixels RGB. So, I'm thinking of creating a GameColorEffects class which I store references or actual methods of GameColor like changeHue, and then I use GameColorEffects somehow to change a whole BufferedImage more efficiently, what's the most efficient way I can store methods or their reference of GameColor and then later apply them on each pixel of a BufferedImage using GameColorEffects. So all I do is initiate GameColorEffects with methods or reference from GameColor, and then I can apply it to easily transform each pixel.

View Replies View Related

Moving Object In Y Axis

Jul 10, 2014

I just have one problem with a "car" program in java. The objective is to move the car in the direction it is facing. Moving forward in the normal position (when the angle is zero) means moving in the x-axis. Choosing to turn the car function (for example: 90 ) and then using the forward function should move up or down the car in the y-axis. However the y-axis is not working.

Car2 Demo.rar
JPGMoveforwardfunction.jpg

View Replies View Related

Effect Of Calling Real Service Call In Test?

Jul 17, 2014

I am trying to understand the effect of calling real business logic from the test class. If I have a test class that call the service method which make update to DB. Is DB really changes through test class?

e.g.

Java Code: @Test
public void testUpdate() {
MyDto myDto = new MyDto(paramters to create new myDto object); //creating new dto object
myService.updateMyData(myDto); //passing new dto object for update (DB record really changed??)
MyDto testDto = myRepo.find(myDto.getKey()); //get record for the corresponding key
assert testDto.getSomeProp() == myDto.getSomeProp(); //what testDto.getSomeProp() return? new value send on myDto or old value from DB?
} mh_sh_highlight_all('java');

View Replies View Related

Pong Game - Y Axis Collision Detection

Jan 28, 2014

I have made a "Pong" game and how to check if the ball has hit the top or the bottom of a paddle, however I do know how to check if it has hit the left or right side:

Java Code:

if((BALL.getX() >= LEFT_BAT.getX() && BALL.getX() <= LEFT_BAT.getX() + LEFT_BAT.getWidth()
&& BALL.getY() >= LEFT_BAT.getY() && BALL.getY() <= LEFT_BAT.getY() + LEFT_BAT.getHeight())
&& (BALL.getX() >= RIGHT_BAT.getX() && BALL.getX() <= RIGHT_BAT.getX() + RIGHT_BAT.getWidth()
&& BALL.getY() >= RIGHT_BAT.getY() && BALL.getY() <= RIGHT_BAT.getY() + RIGHT_BAT.getHeight())){
BALL.increaseDX();
BALL.setDX(-BALL.getDX());
} mh_sh_highlight_all('java');

It seems as though I would use the same code for checking the top or bottom.

View Replies View Related

Which Axis To Increment / Decrement With Inclusion Of Speed Variable

Jan 30, 2015

if I move object A to one area of the screen I want object B to to move to object A's location but I also want object B to move at a fixed speed (movement variable). How do I go about doing this? Both the x and y coordinates of object B would need to know the coordinates of object A to calculate the distance between the two and to determine how much of which axis to increment/decrement (if that makes sense?) with the inclusion of the speed variable.In other words I'm just trying to create a homing object.

View Replies View Related

How To Switch From One Panel To Another Panel

Apr 5, 2014

I have two(panel1 and panel2) panels in a jframe,all three of them are different classes .

In jframe there is a display panel on which the panel1 and panel2 are called and displayed.

now i have a button in panel1 .i want that when i will click on that button panel2 will be displayed or added to the dispalypanel of jframe.

View Replies View Related

Swing/AWT/SWT :: Java2D Graph Plotting - Divide X And Y Axis With Frequencies

May 29, 2014

I am using Java 2D API to implement Graph plotting. I am able to transform and scale the origin upright.

Now, I need to divide the x & y axes with frequencies (Ex: On Y-axis: 0 10 20 30 40 etc ..) and then plot points (Ex: [34, 54] etc) accordingly.

Which methods to use or way out to make this implementation?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved