SetStroke manipulation post creation

I am working on expanding this first little demo/tutorial at http://javafx.com/samples/Draw/
I have gotten everything the way I want except for 1 thing.
for the stroke of the button to show which line thickness is currently chosen is given by javaFX script code
stroke: bind if (SIZE == size)  then FG  else null //javaFX 1.3Obviously the closest thing I can come up with is
if(SIZE==size) return FG; //javaFX 2.0 or Later
else return null;
//combined with
circle.setStroke(FG); however, no matter how I change or twist them I can never get it to set properly.
The reason I have concluded is that even if I set it up as an if statement or whatever. The problem is that its not being called, once its done being created. So I try and have the setStroke change during the setOnMousePressed() mouseEvent. (If I failed to include enough information, please see the link for the sourcecode java below)
However, due to the nature of things, I run into either the problem of it being an anonymous class not being able to access the particular circle being selected. or for some reason my Group TempC is only appearing to ever have 1 item in it, I had tried setting up a call to getChildren.get(size) // the particular size in question. Assigning it a new setstroke and trying to reinsert it back into the group. However, tempC only ever seems to have 1 circle in it. Technically because they have the same name, I can understand why. They are the same circle with different memory addresses. I also tried a dozen variations from using arrays to whatever. I keep ending up at a dead end.
Any suggestions/ideas would be greatly appreciated!
if you were curious for more information
picture: http://www.newrog.com/javafx/improved.png
demo app: http://www.newrog.com/javafx/draw.jar
source code: http://www.newrog.com/javafx/draw.java (It is a little messy right now)
To address DB question about memory and circles
if I add System.out.print(circleGroup.getChildren().size() + " ");
//after my
circleGroup.getChildren().add(circle);
//  I get "1 1 1 1 1 1 1 1 1"  in the outputNever do they accumulate, there are 9 circles in this group.
if I change it to
System.out.println(circleGroup.getChildren().get(0));  //To pull what this repeating "1" item is
/*I get in the output
Circle@19b5393
Circle@134a7d8
Circle@4fce71
Circle@1c74f37
Circle@12a3722
Circle@62937c
Circle@a31e1b
Circle@15a0305
Circle@17653ae*/So I had assumed or thought? its "the same circle but with different instances, but at different memory location/addresses"
I don't know why the group doesn't view it as a 9 different objects though.
Edited by: namrog on Jul 7, 2011 8:04 AM
Edited by: namrog on Jul 7, 2011 8:09 AM
Edited by: namrog on Jul 7, 2011 9:08 AM

Hi,
for me best would be to implement selected pseudo class so u can use css with it (you can even use hover, pressed pseudo classes to accomplish darker,lighter color or opacity etc), like when it is selected -fx-fill: red, -fx-stroke: blue, not selected -fx-fill: red, - fx-stroke: transparent or any other color.
see this post : Re: Image conversion between AWT and FX
I have used rectangles but it is same with circles both are inherit from shape.
For your code :
circle.setOnMousePressed(new EventHandler<MouseEvent>(){
                 public void handle(MouseEvent me){
                     SIZE = size;
                     if(SIZE == size){
                         circle.setStroke(FG);
                     }else{
                         //other circles? setStroke(BG)
                     updateSize();
             });I have used:
thumb.setOnMouseClicked(new EventHandler<MouseEvent>() {
                @Override
                public void handle(MouseEvent event) {
                    // this handler impl can be done in better way
                    System.out.println("src: " + event.getSource());
                    NodeThumb clickedThumb = (NodeThumb) event.getSource();
                    if (lastThumb == clickedThumb) {
                        return;
                    if (lastThumb != null) {
                        lastThumb.setSelected(false);
                    selectedItem.set(clickedThumb.rect);
                    clickedThumb.setSelected(true);
                    lastThumb = clickedThumb;
                    System.out.println("mainView content -> " + mainView.getChildren());
            });or for the most simple example :
all circles on start don`t have border, when u select one just remember that one (lastSelectedCircle) then u just need to deselect one circle not all, and store new value to lastSelected.
something like this (this is "written on the fly" so dont think that it actually works it is juts pseudo code):
// OLD CODE possible error i did not tried to run your code am tired, well maybe it is only error in my bloody eyes hehe
circle.setOnMousePressed(new EventHandler<MouseEvent>(){
                 public void handle(MouseEvent me){
                     SIZE = size; // -> see down line comment <-
                     if(SIZE == size){  // <------  IMO THIS SHOULD ALWAYS BE TRUE BEACUSE OF SIZE=size; line ****** ERROR LINE ******
                         circle.setStroke(FG);
                     }else{
                         //other circles? setStroke(BG) // any lines here i think wont be executed
                     updateSize();
// NEW CODE
circle.setOnMousePressed(new EventHandler<MouseEvent>(){
                 public void handle(MouseEvent me){
                     // it will be null on start when nothing is selected so you dont have to setStroke
                     if(lastSelected != null) {
                               lastSelected.setStroke(BG); // no need to change other circle BG if there is no multiple selection
                     lastSelected = (Circle)event.getSource(); // to remember last selected so it can be easy deselected
                     // now last selected has new value so set diff stroke -> all this can be also accomplished with ObjectProperty and change listener or pseudo class selected or any other way you know
                     // event.getSource(); or any other method to get selected circle
                     lastSelected.setStroke(FG);
                     updateSize();
             });Hope it helps.
EDITED:
What to say, Daryl don`t answer so fast :) joking. I was slow again writing post and other stuff at same time.
Edited by: jojorabbit on Jul 7, 2011 9:44 PM

Similar Messages

  • Post Creation/Installation Document.

    Hello,
    Is there any formal template for a document, Post Creation/Installation of Oracle Database? As in Control File Locations, Log File location, Environment settings, etc. etc. that is required to be maintained after installing the Oracle Server or post creation of a new database.
    Luckys.

    Take a look at the Optimal Flexible Architecture guidelines. They are document in the installation guides. Below is the link the Windows installation guide.
    http://download-east.oracle.com/docs/cd/B19306_01/install.102/b14316/ofa.htm#CBBEDHEB

  • Large Poster Creation Much Slower

    I have been using Keynote for years to make posters, since it worked so much better than PPT with importing pdf files and opacity and such, but the new 09 update has made working with said posters extremely slow. The simple act of dragging objects now takes 100% of the processing power and the computer is unresponsive for a second or two, anyone else had this problem?

    I'm guessing it's for Scientific or Education research "posters". Apple has a tutorial posted.
    http://www.apple.com/science/productivitylab/#tutorial=researchposter
    I haven't noticed the problem, but I think the processor going to 100% is a little much. How fast is your computer and does the same thing happen when you're just using a one slide presentation?

  • Any business event  is available in  OM   post creation of order

    Hi Every one,
    Once the order is booked, i would like to sync up this order into the 3rd party System. I was looking for the business events provided by oracle.
    Show/Change Sales Order - A business event (oracle.apps.ont.oi.show_so.create) can be raised to trigger generation of a SHOW SO or CHANGE SO XML message. The value of one of the event parameters determines which of the two messages will be generated. The SHOW SO message contains status information about an order and can be generated on demand or as a result of changes to an existing sales order. The CHANGE SO message is used to notify the buyer of changes to a sales order and can be raised as a result of status or attribute changes on a sales order.
    Can we use the above business event for my case. Please suggest.
    Thanks.

    You cannot use that as that event is specifically raised when you have used order import (OI) for the XML integration. If you are entering the order from the front end then you have two options:
    1. Have a node in header level workflow that raises the integration message the way you want it.
    2. Or use ASO order feedback concept. I like this one as this gives you what ever even you need to send to the third party systems. It has information about entire order (all tables information). I have some information in this link , but you can find lot more in documentation and support site.
    Thanks
    Nagamohan

  • Regarding Error in Tax Codes after Creation of Excise Invoice.

    Dear All,
    We are using TAXINN Procedure,I have maintained condition records and given the correct tax codes in them for Basic Excise Duty,Secondary Cess and Higher Secondary Cess on the table 357,however after checking the accounting document which is created post creation of excise invoice the wrong tax codes are getting picked up however when i create my commercial invoice and check the tax codes the correct tax codes are coming,please advice what needs to be done to rectify this error.
    Best Regards
    Atul Keshav

    This query is now resolved

  • Error in Tax Code after Creation of Excise Invoice

    Dear All,
    We are using TAXINN Procedure,I have maintained condition records and given the correct tax codes in them for Basic Excise Duty,Secondary Cess and Higher Secondary Cess on the table 357,however after checking the accounting document which is created post creation of excise invoice the wrong tax codes are getting picked up however when i create my commercial invoice and check the tax codes the correct tax codes are coming,please advice what needs to be done to rectify this error.
    Best Regards
    Atul Keshav

    Hi
      If you are using TAXINN procedure, check apart from VK11 check you have maintained TAX CODE for excise condition types. Example FTXP or VK19 (using application as TX). Also check whether you are using UTXJ condition type. If you are using UTXJ condition type then please remove it.
       For TAXINN you need not have UTXJ condition type.
    Regards
    MBS

  • Creation of Time Dependent Hierarchy in R/3

    Any ideas on how to create a time dependent Hierarchy in R/3?
    Do we have any existing functionality we can leverage in R/3 for creating and maintaing time dependent hierarchy or through ABAP coding in R/3?
    Any ideas or documentation will be helpful.

    Hi Jasmine,
    check this documents/links to get an idea how to set up hierarchy extractor in R/3
    [How to Create a Hierarchy Extractor for Employees and their Department Managers|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20a709c1-0a8e-2a10-21b4-f779728c63bf]
    Re: Build Hierarchy with ABAP
    How to create datasource for hierarchy
    Double post: Creation of Time Dependent Hierarchy in R/3
    Regards
    Andreas

  • Time dependent hierarchy creation in R/3.

    I know  you can do it in BW. Any ideas on how to do it R/3? Do we  have any existing functionality we can leverage in R/3 for creating and maintaing time dependent hierarchy.
    Any ideas or documentation will be helpful?

    Hi,
    check this threads:
    Custom Datasource for custom Hierarchies
    How to create Hierarchy data sources in R/3
    How to create a hierarchy datasource in R/3
    Double post: Creation of Time Dependent Hierarchy in R/3
    Regards
    Andreas

  • Converting multiple WordPerfect 9 documents into 1 PDF

    Greetings.
    I'm new, hope it's the right place to post and get some insight.
    Does anyone know that Adober Acrobat X Standard support WordPerfect 9 PDF conversion? We would like to convert multiple WP 9 documents into 1 PDF file. However, I did not see such option available from the selection list... that is when I try to convert/select multiple documents, the list does not give me the WordPerfect as the source file type... Any suggestion is welcome.
    Thanks.

    Corel's WP has not been and is not supported by Acrobat.
    Back in the day Corel used an in-house routine to create PDF.
    A few years ago a news release discussed Corel using a Nuance routine.
    Current news release speaks to Corel's PDF Fusion.
    So, yes PDF can created out of WP; just not with Acrobat.
    To learn what PDF creation or post-processing features Corel has or does not have you'll want to visit Corel's web space.
    If you want amped up PDF manipulation / post-processing you'll want to consider Acrobat Pro.
    Be well...

  • Netbeans: adding to jPanel via code after init (jFreeChart)

    This will be my second post. Many thanks to those who replied to my first questions.
    I am using netbeans 5.5
    I am attempting to run the following jFreeChart demo but in netbeans.
    Original demo located here: http://www.java2s.com/Code/Java/Chart/JFreeChartPieChartDemo7.htm
    Instead of programically creating the jPanel like the demo does, i would like to do it using the netbeans GUI and then add the code to create the jFreeChart.
    In netbeans i create a new project, create a new jFrame and place a new jPanel on the form (keeping the variable name jPanel1) as illustrated below:
    * MainForm.java
    * Created on June 28, 2007, 1:48 PM
    package mypkg;
    import org.jfree.chart.ChartFactory;
    import org.jfree.chart.ChartPanel;
    import org.jfree.chart.JFreeChart;
    import org.jfree.chart.plot.PiePlot;
    import org.jfree.chart.plot.PiePlot3D;
    import org.jfree.data.general.DefaultPieDataset;
    import org.jfree.ui.ApplicationFrame;
    import org.jfree.ui.RefineryUtilities;
    * @author  me
    public class MainForm extends javax.swing.JFrame {
        /** Creates new form MainForm */
        public MainForm() {
            initComponents();
        /** Netbeans Auto-Generated Code goes here which I have omitted */                       
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new MainForm().setVisible(true);
        private void CreateChart() {
            DefaultPieDataset dataset = new DefaultPieDataset();
            dataset.setValue("Section 1", 23.3);
            dataset.setValue("Section 2", 56.5);
            dataset.setValue("Section 3", 43.3);
            dataset.setValue("Section 4", 11.1);
            JFreeChart chart3 = ChartFactory.createPieChart3D("Chart 3", dataset, false, false, false);
            PiePlot3D plot3 = (PiePlot3D) chart3.getPlot();
            plot3.setForegroundAlpha(0.6f);
            plot3.setCircular(true);
            jPanel1.add(new ChartPanel(chart3));
            jPanel1.validate();
        // Variables declaration - do not modify                    
        private javax.swing.JPanel jPanel1;
        // End of variables declaration                  
    }I then attempted to call the CreateChart() function in several places (in the MainForm() function, in the pre and post creation code properties of the jPanel's properties dialog in netbeans (as well as pre and post init in the same screen)) and nothing seems to work. the program compiles and the jFrame comes up but the chart does not show.
    If i run the example at the above noted link it runs fine in netbeans if i copy and paste the code directly, it just doesnt work when i try to get it to work through the netbeans GUI builder and the jPanel i create through it.
    Can any more advanced netbeans/java users lend me a hand or point me in the right direction?
    NOTE: in the code pasted above, i am only trying to run one of the four chart demo's listed in the original source in the link.
    NOTE2: in the code pasted above it doesnt show me calling CreateChart() from anywhere, im hoping to get some advice on how to proceed from here.
    Message was edited by:
    amadman

    Here is the netbeans generated code that i had omitted in the post above:
    private void initComponents() {
            jPanel1 = new javax.swing.JPanel();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            CreateChart(); //this is one of the many places i tried sticking the function
            javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 546, Short.MAX_VALUE)
            jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 398, Short.MAX_VALUE)
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap())
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap())
            pack();
        }// </editor-fold>   I believe this is what you mentioned looking for, or close to it:
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);any thoughts?

  • OIM 9102: Send Email Notification to other user in a task

    I created a process in OIM. In this process exist a Task: Manager Process. When this task will be completed for the user that be assigned. In the Notification Tab are able to send a email notification to a Assign User, Requester User, User or User Manager. But i need to send a email notification a other user different to them, for example: juan.perez, this user is in OIM.
    I have read the following documents:
    1.- http://docs.oracle.com/cd/E10391_01/doc.910/e10363/promgt.htm#BCECFGEJ
    2 .- How to Send an Email Notification Upon User Creation via the Admin Console [ID 780394.1]
    3.- OIM: An Example of Email Notification and Configuring it With a Resource Object Provisioning [ID 457836.1]
    4.- Sending an Approval Notification Email with a Link Directly to the Approval Request? [ID 748447.1]
    Or exist some way to do this, through java code.
    I'm using oim 9.1.0.2 BP18 running on OC4J 10.1.3.5 on AIX 6.1 64-bit clustered install with two nodes, Oracle Database 10.2.0.4 on AIX 6.1 64-bit on RAC.

    Hi
    You can use OIM email API to send an email from the java code. You can attach code on post creation user using entity adapter. Every time a user is created the email is triggered.
    Here is the sample:
    public EmailUtility(tcDataProvider dataProvider) {
              this.dataProvider = dataProvider;
              emailOper = new tcEmailNotificationUtil(dataProvider);
              System.out.println("Email API instantiated successfully...");
         public String sendEmail(String fromAddress, String toAddress, String body,
                   String subject) {
              emailOper.setBody(body);
              emailOper.setFromAddress(fromAddress);
              emailOper.setSubject(subject);
              emailOper.sendEmail(toAddress);
              System.out.println("Email sent!" + subject);
              return SUCCESS;
    Regards
    user12841694

  • Mb1c problem 501

    Dear Sap experts,
    I am using mb1c 501 mv type.While doing it I am giving vendor no .
    Posting & creation of material , accounting document is ok.
    But how can I see the laibilities getting transfered to vendor account.
    In fk10n or fbln1n there is no record in existance for that particular vendor.
    So how can see that is any custmising setting needed.?
    Pls help me out.

    hi
    it will just show u entry of
    inventory acct --dr
    other revenue acct ---cr
    http://www.sapstudymaterials.com/2007/12/accounting-fico-journal-of-mm-goods.html#501
    now the vendor liablities have to be pay manually from FI side using FB60 and folowed by payment to vendor
    hope it help
    regards
    kunal

  • How to apply passwords to existing PDF files?

    My MS-Access app creates about 1000 pdf files.  Each file is required to have a unique password and will be emailed as attachments via a VBA procedure in Outlook 2007.    Certificates are not feasible, despite my objections.  So I am looking at having to manually set the 'Open File' password for each file individually.  The files are created in an Access '97 VBA procedure (by sending the results of an Access Report to the Adobe PDF Printer).  Is there any way with VBA (either Access '97 or Outlook '07) to apply a unique security policy or otherwise set a unique 'Open File'  password for each of the files, either as they are being created and saved - or after the fact?
    I can create an Action in PRO X and manually select all the files and set the passwords.  I can then encrypt and password-protect all the files at once - but they all get the same passwords - ok for 'Permissions', but not for 'Open'.  Can Action fileds be modified from VBA?  Or is there a way to creat an Action that can modify another Action?  For example, if there is an Action named "Apply Pswd" which will apply a predefined common set of passwords to all files selected, can there be an Action, named "Apply Unique Pswd" that will update the 'Open' password field in the "Apply Common Pswd" Action as well as the name of the individual file that is to have that password?  Sort of like passing parameters to a function.  i.e.:
    "Apply Unique Pswd":
    1. Get next .pdf file from directory.
    2. Get next password (whether caluclated or read from a list).
    3. Open the "Apply Common Pswd" Action.
    4. Change the 'Open' password and the name of the file to select (the 'Permissions' password does not change).
    5. Execute the "Apply Common Password" Action - which at this time is only affecting a single file.
    6. Verify the 'Open' password (or bypass the verify step, if possible).
    7. Loop through all files in the directory.
       or
    3.   Don't use Actions - save the .pdf file in such a way that the common 'Permissions' password and the current 'Open' password are applied to the appropriate file.
    3a. Goto 7.
    I have also investigated Secure Envelopes in Outlook, but again, it appeas to be a manual procedure to apply unique passwords.
    I would greatly appreciate any tips, suggestions, snippits, or ideas - or enlightenment that it is just not possible to create .pdf files with passwords in VBA nor to use VBA to set the passwords post-creation.

    usna73tx  
    I am looking for similar thing, I need to apply a password and permissions to thousands of PDF files & I do not want to open them all manually.
    Did you ever find a solution?

  • How to change margins in Id, after a document is defined?

    We are designing a book in Id and already have a dcument defined.  We have searched high and low.  But we find nowhere to change the margins of the document, post-creation.  (Of course those options present themselves, during document creation itself.)
    Yes, we are newbies to Id and most appreciate the help.  Thanks.
    David Allen

    Hi,
    Select the master pages in the "Pages" panel and go to menu "Pages", sub-menu "Margins & columns" (I use a french version, so may be the translation is incorrect!).

  • Lookup Column in Same List

    Hi all,
    I know that this goes against all the laws of circular references, but is there an out of the box method to lookup a column value in the same list (ex. have a field for sub project that pulls from project name)?
    Regards,
    Kelly
    Personal Blog: http://thebitsthatbyte.com

    That's a good idea, but I have had problems with the Calculated Columns losing their formula. Instead, I will create a separate list that a workflow writes a value to post creation of a parent item. Then using a lookup column, I will have the values
    I need.
    Personal Blog: http://thebitsthatbyte.com

Maybe you are looking for