Object Co-ordinates

so ive been trying to get my button (btnPos1U) to spawn in each corner of the stage every 2 seconds. the timer works great but every time i change the co-ordinates in the math.random it seems to move the whole stage as well as the button. has any one got a fix for this? my project is due tomorrow.
the coordinates that are in there at the moment are for the bottom right, my other coordinates are
x=2.4
y=2.7
x=243.9
y=2.7
x=1.7
y=400.6
i am stumped on how to use this plotting data to tell my button where to be.
import flash.events.MouseEvent;
addChild(btnPos1U);
btnPos1U.x=btnPos1U.y=0;
var positionA:Array=[[stage.stageWidth-btnPos1U.width,0],
                     [0,stage.stageHeight-btnPos1U.height],
                     [stage.stageWidth-btnPos1U.width,0],
                     [stage.stageWidth-btnPos1U.width,stage.stageHeight-btnPos1U.height]];
var t:Timer=new Timer(2000,0);
t.addEventListener(TimerEvent.TIMER,f);
t.start();
function f(e:TimerEvent):void{
btnPos1U.visible = true
btnPos1U.x=Math.floor(Math.random()*(x=243.9))
btnPos1U.y=Math.floor(Math.random()*(y=400.6))
btnPos1U.addEventListener(MouseEvent.CLICK,g)
function g (e:MouseEvent):void
    btnPos1U.visible = false
    init();
    btnNeg1.addEventListener(MouseEvent.CLICK, EndUnlimited);
    btnNeg2.addEventListener(MouseEvent.CLICK, EndUnlimited);
    btnNeg3.addEventListener(MouseEvent.CLICK, EndUnlimited);
    btnNeg4.addEventListener(MouseEvent.CLICK, EndUnlimited);
    btnPos1U.addEventListener(MouseEvent.CLICK, on_press);
function EndUnlimited (e:MouseEvent):void
    gotoAndPlay(102);
stop();

this is almost certainly not what you want:
btnPos1U.x=Math.floor(Math.random()*(x=243.9))
btnPos1U.y=Math.floor(Math.random()*(y=400.6))
try:
import flash.events.MouseEvent;
// the width&height of each corner quadrant
var quadrantSize:int=100;
addChild(btnPos1U);
btnPos1U.x=btnPos1U.y=0;
var positionA:Array=[[stage.stageWidth-btnPos1U.width,quadrantSize],
                     [quadrantSize,stage.stageHeight-btnPos1U.height],
                     [stage.stageWidth-btnPos1U.width,quadrantSize],
                     [stage.stageWidth-btnPos1U.width,stage.stageHeight-btnPos1U.height]];
var t:Timer=new Timer(2000,0);
t.addEventListener(TimerEvent.TIMER,f);
t.start();
function f(e:TimerEvent):void{
var i:int=t.currentCount%positionA.length
btnPos1U.visible = true
btnPos1U.x=quadrantSize+Math.floor(Math.random()*(positionA[i][0]-quadrantSize))
btnPos1U.y=quadrantSize+Math.floor(Math.random()*(positionA[i][1]-quadrantSize))
btnPos1U.addEventListener(MouseEvent.CLICK,g)
function g (e:MouseEvent):void
    btnPos1U.visible = false
    init();
    btnNeg1.addEventListener(MouseEvent.CLICK, EndUnlimited);
    btnNeg2.addEventListener(MouseEvent.CLICK, EndUnlimited);
    btnNeg3.addEventListener(MouseEvent.CLICK, EndUnlimited);
    btnNeg4.addEventListener(MouseEvent.CLICK, EndUnlimited);
    btnPos1U.addEventListener(MouseEvent.CLICK, on_press);
function EndUnlimited (e:MouseEvent):void
    gotoAndPlay(102);
stop();

Similar Messages

  • Getting a x- and y-ordinate of a point object

    Can anybody tell me how I simply can get de x- and y-coord of a pointobject using sql
    I need to update the X and Y field in a spatial table based upon the spatial object in the same table.
    It must be a simple SQL, but I can't find it.

    Hi Mark,
    try it like this:
    select * from table ( select b.geom.sdo_ordinates from gemetry_table b
    where rownum < 2 )
    for geometry_table you have to insert your geo-feature, Rownum is a sample of limiting objects to _1_ Object from
    your Objects-List.
    Substitute rownum with your unique Object_Identification.
    The other way is to write a simple function:
    create function get_geom_ordinate( geom, position) returns number
    as
    begin
    return ( geom.sdo_ordinates(position));
    end
    And use it :
    select get_geom( geom, 1) as 'X' , get_geom( geom, 2) as 'Y'
    from geometry_table
    where Objects# = '0815';
    Good Luck
    Stefan
    Landeshauptstadt M|nchen

  • How to change default vertical page co-ordinates from center, to top?

    Hi There,
    We're having trouble understanding why InDesign centers the page instead of aligning the view to the top when switching pages (and copying and pasting) - and how to change this behavior.
    To understand what I'm talking about, do the following:
    Create a new document (any size)
    Use the page tool to to change the height
    Create a new page and use the page tool to make the height a lot taller
    Now switch between the pages
    Notice how InDesign always shows you the center of the page?
    This is frustrating in many situations like copying and pasting - try the following:
    Create a box on the first page and align it to 20mm from the top and 20mm from the left
    Copy the box
    Switch to the second page
    Paste using CMD + OPT + SHFT + P
    The object should be pasted in the same spot (20mm from the top and 20mm from the left) but it isn't - on the vertical, it's pasted relative to the center of the page for some reason.
    It surprising how annoying this becomes when you're constantly re-positioning pasted items or when switching between web layouts of different heights - it becomes a two step process instead of one.
    Does anyone know how to change this behavior?
    Any pointers in the right direction would be much appreciated - we're using CS5.5
    Cheers
    Ben

    Thanks for the replies - sorry I didn't reply earlier but they went to junk.
    Why in the same spot if pages have different size?
    In general, sure - but what about letting the user define a point of reference? For me, it's always the top left corner like the rulers - I completely understand if that doesn't work for others but it would save me so much wasted time constantly repositioning objects.
    Also, in a lot of documents with different page-sizes, setting the reference to top left (or whatever you set your rulers to) actually works a lot of the time - granted, probably only for those that use the numbers to position objects.
    Anyway, what I'd like to do is find out how to set a document-wide reference point for co-ordinates - obviously you can't do this right?
    Another thing that wastes time (in a similar vein) is the ability to set defaults for translation, rotation and flipping etc.
    Almost without fail, I find I want top left when moving (because I set rulers to top left) but center for rotation and flipping. Being able to set a default per translation type would save a lot of pointing and clicking.
    Is this possible?

  • DAO and Domain Object

    hi,
    Normally when i want to persist a domain object like Customer object to a database, my statements will be below,
    // code from my facade
    Customer cust = new Customer();
    cust.setFirstName("myname");
    cust.setLastName("mylastname");
    // set another attributes
    cust.create();
    with this code i have a CustomerPersistence object to handler for create this customer record to a database. Now j2ee have a DAO pattern. So my question is,
    1.where is a domain object within DAO pattern? --> because of we can reused domain object.
    2.DTO is Domain Object, isn't it?
    3.when i look at some articles about DAO, many of it will present in this way
    facade -->create DTO --> call DAO (plus something about factory pattern)
    i never see something like this
    facade --> domain object --> dao
    any suggestion?
    anurakth
    sorry for my english!!

    Hi,
    I am a bit confused about implementation of the domain model and I wondered if you could help. My main concern is that I am introducing too many layers and data holders into the mix. Here is what I am thinking.
    DTO - used to carry data between the presentation and the services layer
    Service Class - coordinates the calling of domain objects
    Domain Object - models a domain entity, service layer logic specific to this object is to be implemented here.
    Data Object - an exact representation of a database table. many to many relationship between domain object and data object.
    Hibernate DAO Class - has no properties, just methods used for read and writing the object to the database. It is passed in the Data Object for persistence. Is it wrong that the DAO contains no properties?
    Perhaps the domain object will contain each data object it is comprised of. I was originally going to keep calls to DAOs in the Services class (as recommended in http://jroller.com/page/egervari/20050109#how_to_change_services_logic ) but I am thinking that each domain object could expose a save method, and that method would co-ordinate persisting itself to the various tables it is derived from.
    Does this sound resonable? I have trouble finding a pattern on the net that clealy defines the Domain Model. I was tempted to map Domain Objects directly to database tables, and simply persist the Domain Object, but this 1-1 relationship may not always hold true.
    Thanks.

  • How to create VB Object for a pdf embedded in IE 6 Browser?

    I'm hoping to automate the testing of PDF forms on our web based application. Each PDF form is embedded in IE 6 below a series of hyperlinks. I'm trying to write a VB function which accesses the PDF form already opened in the IE Browser, clicks on the "Button 1" button embedded in the form, then clicks on "Button 2" button. The buttons are in the PDF in the form of gray boxes - Button 2 becomes visible after Button 1 gets clicked. are I've a series a questions on how I get about implementing that.
    * Set pdDoc = CreateObject( "AcroExch.PDDoc" ) How do I make this pdDoc object point to the already open pdf in the browser. The pdDoc.Open() does not seem to accept a URL. Neither does the url end with a ".pdf" since the pdf is displayed at a lower hierarchy in the screen.
    * Currently I'm using the TextSelect method to search for "Button 1" button and then get the co-ordinates for the selected text. Is there any method to get the mouse to click the co-ordinates or to identify the buttons in the form itself?
    I'm very new to the SDK. I've Acrobat 8 & VB installed on my PC. I've read the IAC & related guides but can't seem to make a headway. Any help would be much appreciated.
    Thanks in Advance.

    Thanks for the update Leonard. This would be an extremely useful plugin. I've been looking for it on http://labs.adobe.com/technologies/ under the plug-ins tab but have been unable to find it. It wasn't even there in the Pre-Release Programs. Is it located somewhere else or with a different name? Please let me know.
    Meanwhile, I've been trying to write my own VB script to get the button clicked. Here's what I've come up till now-
    FindText
    HiliteList.Add->CreateWordHilite->SetTextSelect->GetBoundingRect->PointToDevice
    The last function seems to be deprecated. Also there's nothing to connect the text highlighted by findtext with HiLiteList.Add. I guess
    I may have to use the JSO word search method.
    Any advice, as always, would be much appreciated.

  • Smart Objects in CS5 behave differently than in CS4?

    I've just upgraded from CS4 to CS5, and I've noticed, what is to me, a BIG change in the way Smart Objects work.
    Imagine this simplified hypothetical scenario...
    I create a document in Illustrator, with two layers.
    On one layer would be a 800x600 solid rectangle. On another layer I'd put a small 50x50 circle.
    The import thing here is that the circle would be positioned roughly in the top-left corner in relation to the rectangle.
    I'd select both objects, go over to Photoshop, create a new 800x600 document, and paste what I've just copied into the document as a Smart Object.
    Photoshop would treat both Illustrator layers as one Smart Object of course, and they would get pasted together, and they would look exactly how they did in Illustrator - that being the circle positioned in the top left corner of the rectangle.
    Now I decide I want to hide the solid rectangle in my Smart Object, but I want to keep the circle exactly as it is now in the Photoshop document.
    So I simply double-click to edit the original Illustrator file, and then I hide the layer with the rectangle on it, save the file, close it, and go back to Photoshop.
    In CS4, the file would update to show the changes I had made, so the rectangle would disappear and only the circle would remain - and importantly, the circle would maintain its position. It would stay in the top-left corner of my Photoshop document (the rectangle still exists in the original Illustrator file, but the layer it's on is simply hidden).
    However, when I do this exact same process in CS5, when I update the Smart Object after hiding the rectangle layer in Illustrator, the Smart Object seems to ignore the rectangle that is hidden in the file, and the solitary circle that remains gets totally shifted into the centre of the 800x600 Photoshop file. So it is now no longer in the top-left corner where it was before.
    This is causing me HUGE problems, because I have painstakingly positioned many many various objects in my Illustrator files which then get shifted out of place whenever I make an adjustment!
    Is there any way to get CS5 to treat Smart Objects in the same way that CS4 did before it?

    Regards your comments above, yes I am aware of that discrepancy, but I very carefully make sure not to change the size or position of the largest object. In other words, when ALL objects on ALL layers are selected, I make sure that the OVERALL X/Y co-ordinates AND X/Y dimensions do not change between adjustments of various isolated objects.
    (I actually deliberately keep a "spare" oversized rectangle on a bottom layer to maintain overall size, and it's this layer that I normally switch off in my final Smart Object.)

  • PageItem Co-ordinate w.r.t. Spread Co-ordinate System

    Hi All,<br /><br />I am trying to get coordinates of text frame with respect to spread co-ordinate system.<br />I have used following code for this:<br /><br />InterfacePtr<IGeometry> frameGeometry(textFrame, IID_IGEOMETRY);<br />PMRect frmRect = frameGeometry->GetPathBoundingBox();<br />::InnerToParent(textFrame, &frmRect);<br /><br />Here textFrame is the ITextFrame pointer of which I want to get coordiantes w.r.t. Spread. The problem is dimensions in frmRect doesnot change even after transformation using InnerToParent().<br /><br />Can anyone suggest me in this regard, where I am wrong?<br /><br />- Pete

    Hi Pete,
    I think your problem is that the parent of kMultiColumnItemBoss or kFrameItemBoss (the only bosses that could store the ITextFrame interface you start from) is kSplineItemBoss and not kSpreadBoss. With your call to TransformUtils::InnerToParent you are likely getting the coords in the spline item's coordinate space and not in the spread's one. The SDK documentation specifies that "The parent coordinate space is the first ancestor boss object on IHierarchy that has an IGeometry interface".
    HTH,
    Emanuele.

  • Problem: mapping mouse co-ordinates to a list of nodes in a graph.

    Hi.
    I have an undirected graph containing many nodes, some represent squares/tiles and some represent rooms in a board-game called Cluedo.
    Each node has an ID: -
    Rooms are called by the room name. -> Kitchen/Lounge
    Squares are called by the concatenated x/y position. -> A1/A2/K20
    I have created an algorithm to find the shortest path between two nodes in the graph.
    The problem I'm faced with is finding a way to map co-ordinates on the image file to these IDs. I have seen an implementation of a similar idea with an invisible image acting as a "colour-mask", so when the click hits the graphical map a function works out the colour of that pixel on the "colour-mask" and then uses a look-up table to find out which ID that is associated to.
    The problem with the above is that a Cluedo board has about 22x22 tiles and several rooms (each room would occupy several tiles in an undefined shape.)
    I've provided two example map files:
    http://www.dcs.qmul.ac.uk/~ade1/map.gif
    http://www.dcs.qmul.ac.uk/~ade1/map2.gif
    Does anyone have a suggestion of how I could solve this problem using what's available to me with Java?
    I'd appreciate any suggestions,
    Alexander Ellis

    Create a two-dimensional array that maps from grid coordinates to node/room objects.
    NodeOrRoom[][] grid = new NodeOrRoom[22][22];
    grid[0][0] = kitchen;
    grid[1][0] = kitchen;
    nodeLookup(int pixelTop, int pixelLeft) {
      return grid[pixelTop / gridCellHeight][pixelLeft / gridCellWidth];
    }Matthew

  • How to Query Sdo_Geometry Object of ORACLE SPATIAL in PHP?

    Hi,
    I am trying to Query the Oracle Spatial's Geometry object in the PHP page but its giving me the ADT Error. How can i see the GEOMETRY object information on the web using PHP. Thanking you in advance and waiting for ur prompt reply.
    Adnan!

    Hi Ana,
    In the Query below its returning the result as each value of one row in diffrent rows i wanna ask from u is:
    1- May i get all these values in one row ?
    2- Second, i want to query more than one row values from the table? as this is a single row subquery.
    Thanks for your help and i m looking forward for a positive reply from you.
    Regards,
    Adnan!
    The following select lists all ordinate-values from ONE object in the table:
    select *
    from table(select a.<column_name>.sdo_ordinates
    from <table_name> a
    where ID = xxxx
    *******************************************************************

  • Vector clone references the same objects??

    Hi all
    I'm developing a simple chess program.
    Obviously, each move the user tries must be checked against the following sets of chess rules:
    1.) Whether it is that colour player's turn to move
    2.) Whether this move is valid for this specific piece (eg. 3 forward for a King --> invalid of course)
    3.) Whether this move will jeopardize the player's king (put it in check)
    If from any of the above the move is found to be invalid, the move is not executed.
    My program structure is briefly this:
    A. abstract super class 'ChessPiece' - subclassed by the various specific Chess Piece classes.
    Each of the specific ChessPiece subclasses must implement an abstract method to check if a
    proposed move is valid, and also a method to actually do the move...
    B. 'PieceManager' class - has a Vector of ChessPieces:
    This class checks whether the given move is valid:
    For the piece: by calling the checking method (see A above)
    For the general game: by making sure the given move doesn't put the player's king in check.
    NOTE: In chess (for those who don't know), it is illegal to move any piece if, at the end of
    the move, your king will be in check [possible to be captured by any enemy piece]
    This last check I want to do in the following way:
    1) copy/clone the entire PieceManager object
    2) in this copied object, actually do the move
    3) still in the copied/cloned object, see if the moving player's king is now in check
    4) based on this evaluation, execute the move in the original PieceManger object or don't...
    The Problem:
    When I clone this PieceManager object, its 'pieces' Vector is obviously also cloned.
    BUT it seems that the cloned 'pieces' Vector references the same ChessPiece objects
    as those referenced by the original 'pieces' Vector; ie the 2 Vectors are sharing the same Objects.
    Thus, when I actually execute the move in the test/cloned PieceManager object,
    the original PieceManager's corresponding piece is moved too (well, it seems it is the same piece...).
    I am pretty stuck with this.
    I've tried the Vector clone method; it doesn't seem to copy the objects, but create another reference
    to the same objects, as I've said.
    I've tried cloning the entire object ; also not helping......
    I'd love any comments, helpful pointers, suggestions.
    Also any comments on my program structure... is a Vector the best tool for this job?
    Thanks very much -
    lutha

    Hi all, OP here.
    Ok thanks guys for all your posts...
    two points:
    1) I have tried the "copy constructor", and it seems to be doing the same thing. (ie 'shallow clone')
    What's really frustrating me is that nothing I do seems to actually physically copy the Vector's objects
    to new, separate copies of those objects...
    I had my PieceManager class implement Cloneable (just in case - not too sure on that one; in fact I
    commented that out later), and I overrode the clone method like this:
    public Object clone ()
            PieceManager pm = new PieceManager ();
            Vector pcs = new Vector ();
            // Enumeration e = pieces.elements ();
            //while (e.hasMoreElements ())
            //    ChessPiece p = (ChessPiece) e.nextElement ();
            //pcs.add ();
            //}  // still references the same objects!!
            pieces.trimToSize ();
            int size = pieces.size ();
            Object[] arr = new Object [size];
            Object[] initial = pieces.toArray ();
            System.arraycopy (initial, 0, arr, 0, size);
            for (int i = 0 ; i < size ; i++)
                ChessPiece p = (ChessPiece) arr ;
    pcs.add (p);
    pm.pieces = pcs;
    return pm;
    This all still does the same 'shallow cloning'...
    2) m.winter, my ChessPiece objects are not immutable - they have a co-ordinate field that
    changes as they are moved. This is for getting as called by another object, and for checking in
    the ChessPiece's own internal method for checking whether the passed-in square co-ordinate
    is a valid destination.
    Anyway, I don't think that's the main issue here. How can I properly clone/copy a Vector, resulting
    in :
    a) the original Vector
    b) a new, totally unrelated Vector.
    Thanks again all for your input.
    regards,
    lutha

  • X and y co-ordinates - how to get rid of them??

    Hello
    When I click and hold to drag an object I keep getting a little box just under the arrow which details the x and y co-ordinates. How do I get rid of this? I can't figure out how to do it but I'm sure there must be a way!
    Thanks

    Go to the application preferences (Edit > Preferences.. on Windows, InDesign > Preferences... on Mac) and uncheck the "Show Transformation Values" checkbox in the top section of the Interface screen.

  • Iterate through a set of scatter graph objects (paths) and replace with Brush or Symbol instances.

    I am trying to write write a script for Adobe Illustrator (AS or JS) which takes a set of objects and one by one replaces them with a brush style applied to a single point (one anchor path) or a symbol instance. Needs to be accurate as it's a graph with 300 'points'.
    Looking for help with the following tasks:
    Selecting all the paths belonging to a particular layer named "Replace". (Even if User input to a dialogue is required I only know how to use layer item numbers)
    How to get the central co-ordinates of a small path that makes a shape like a triangle, square, circle or diamond. Some of the sets are compound paths but they are all symmetrical but for the triangle and I want the centre (X,Y) to assign as properties for the Brush anchor point or Symbol anchor point.
    How to change layers from one layer (containing the set of paths) to a new drawing layer (where script will create the symbols/brush instances)
    What I'm also wondering:
    Would it be best to iterate the sample set and get cords and draw create the new symbol instance (possibly in a new layer and possibly delete the originating path) one by one as it were? Or be best to run through all the points and create a data record of all the co-ordinates then iterate a second time and create all the objects using the co-ordinates for symbol (X,Y) anchor properties
    All I have to work from is the sample Adobe Script that creates a tree symbol the duplicates it around the edges of the page. Not quite there yet :-)
    One of the reasons I'm doing this is that I can then stretch the graph to expose the data and not have to transform each to get the shapes back into shape but mainly because some of the paths are very jaggy and ugly out of the stats program (Excel?!).
    Sample File: link
    Before is like this: After is like this:

    Jaggy like this

  • Extracting ordinates

    Can anyone tell me if it is possible to extract the X + Y values from an SDO_GEOMETRY in a form that allows one record per pair of ordinates?
    I have two queries that I would like to combine in order to return the following example record set...
    ID X Y
    a 1 1
    a 2 1
    a 2 2
    a 1 2
    This query lets me extract the object id a...
    select A.ID
    from MPCOAST A
    where sdo_relate(A.SHAPE,
    mdsys.sdo_geometry(2003, null, null,
    mdsys.sdo_elem_info_array(1, 1003, 3),
    mdsys.sdo_ordinate_array(0, 0, 5, 5)),
    'mask=anyinteract querytype=window') = 'TRUE';
    And this one gets me all ordinates for object a...
    select c.id, a.column_value ord
    from mpcoast c, TABLE(c.shape.SDO_ORDINATES) a
    where c.id = 'a';
    My problem is that the second query returns one record per ordinate not pair of.
    I would like each record to contain both X and Y ordinates for each point in each object.
    Any help would be helpful.
    BTW: Why os the spatial documentation so difficult to comprehend? Thank goodness for this forum!

    This works with my data. It is three-dimensional. So you will have to adjust for two-dimensionsal.
    set serveroutput on
    SET serveroutput on SIZE 1000000
    set concat on
    DEFINE layername = 'CO19_LRS';
    DEFINE geomcolname = 'GEOM';
    DECLARE
    id varchar2(10);
    longitude number;
    latitude number;
    logmile number;
    i number;
    theLayer varchar2(32);
    theGeomCol varchar2(32);
    BEGIN
    FOR rec IN (SELECT ROWID, id, &geomcolname FROM &layername ) LOOP
    id := rec.id;
    i := 1;
    while i < rec.geom.sdo_ordinates.count loop
    longitude:=rec.geom.sdo_ordinates(i);
    latitude:=rec.geom.sdo_ordinates(i+1);
    logmile:=rec.geom.sdo_ordinates(i+2);
    dbms_output.put_line(id &#0124; &#0124; ',' &#0124; &#0124; longitude &#0124; &#0124; ',' &#0124; &#0124; latitude &#0124; &#0124; ',' &#0124; &#0124; logmile);
    i := i + 3;
    end loop;
    END LOOP;
    commit;
    END;
    Dave

  • Hotspotz co-ordinates

    I have a reciprocal tapping test done out and i want to make the rectangles in black become a hotspot. But
    the only thing is i cant figure out how the co-ordinates work on the little bugger. Normally its x y width height,
    but i dont know!
    Heres the code should ye wish to have a gander!
    Reciprocal Tapping
    This program should show a decresing level of hits to the centre of the black
    plates on the screen. The idea was taken from a test also done by Fitts law
    proving that over a length of time the user will miss and become slower and less
    accurate.
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    <applet code = "ReciprocalTapping" width = 780 height = 500>
    </applet>
    public class ReciprocalTapping extends Applet implements MouseListener, MouseMotionListener{
    Label aLabel = new Label ("Reciprocal Tapping Test");
    int mouseiPressed = 0;
    public void init () {
    //super ("Copyright � BJMORTELL");
    add(aLabel);
    aLabel.setLocation (10,540);
    addMouseListener (this);
    addMouseMotionListener (this);
    public void paint (Graphics g) {
    //initial rectangle plain with no colour
    g.drawRect (100,100,585,180);
    //first black rectangle totally black these will have a actionlistener added
    g.fillRect (185,100,50,180);
    g.setColor (Color.black);
    //rectangle but this one hasn't got any colour in it
    g.drawRect (150,100,120,180);
    //second black rectangle totally black these will have a actionlistener added
    g.fillRect (535,100,50,180);
    g.setColor (Color.black);
    //rectangle but this one hasn't got any colour in it
    g.drawRect (500,100,120,180);
    //Mouse listener event handlers
    public void mousePressed(MouseEvent e) {
    public void mouseEntered(MouseEvent e) {
    public void mouseExited(MouseEvent e) {
    public void mouseClicked (MouseEvent e) {
    public void mouseReleased (MouseEvent e) {
    //mouse motion listener event handlers
    public void mouseMoved (MouseEvent e) {
    int x = 0;
    int y = 0;
    x = e.getX();
    y = e.getY();
    //I want the hotspot to be over the black rectangles
    if((x>100&&x<180)&&(y<100&&y>180))
    showStatus ("Here i am");
    public void mouseDragged (MouseEvent e) {

    You should use the java.awt.Rectangle object, which has a "contains" method. If properly used, that should do what you're trying to do. By the way, the (y < 100 && y > 180) would never be true so that might be why you're having the trouble. Another reason for using Rectangle.

  • Co-Ordinate precision and performance

    I have data with a geometric tolerance of 0.05
    The precision of the co-ordinates can be up to 3 decimal places in the SDO_GEOMETRY object. (0.001)
    However when we query the data through MapXtreme web application the query window passed in to the second geometry parameter of the sdo_relate query has a precision of 9 decimal places. Will this high precision affect sdo_relate query performance, compared to a query window definition with only 2 decimal place precision.
    Regards

    Usually a query window only has a few coordinates, so even if high precision did have an effect, in this case it would be negligable.
    However, we don't think high precision will have a detrimental effect in general anyway.

Maybe you are looking for

  • Camera to capture ID Photos with Live View tethering and Inexpensive.

    Need suggestions for a relatively cheap webcam or point and shoot camera I can hook to the MBP and control it with live view functionality. Needs to be able to take a stills suitable for ID Photos for a printed conference ID. It would be nice to be a

  • Problem Querying Oracle Forms Using a Date Field and a Format Mask

    Hello, We are experiencing a problem with Oracle Forms that I was wondering if you can help me with. We have several Forms that have single database blocks assigned to Oracle tables. The Forms are queryable and one of the fields we're querying on is

  • Processing WS-Security headers within a web service

    Hello, I have created a service with WS-Security (from a WSDL using jdeveloper) and deployed it on OC4J. Within the service implementation, I need to get some information from soap security header, that is, my service needs to process some security h

  • Look-up java time zone based on location?

    I have a test app where I can assign a java timezone and return time info - However, I don't see a way to look-up a java time zone based on location (combination of city/province/state/country). Is this possible?

  • Créer une interface via labview

     j'ai un projet de fin d'étide ou je dois faire une interface entre des lignes de production et le PC dans mon cas j'ai 8 leds chaque led représente une ligne de production quand elle clignote on a l'arrêt de la production s'elle est éteinte elle est