Xoetrope
HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Carousel logo

XRolloverComponent

class com.xoetrope.svg.XRolloverComponent

Used to display printer information in conjunction with the XInfoFileParser class and XStatusInfo interface.

1. Example


    XPrinterInfo printerInfo = new XPrinterInfo();
    printerInfo.setSize( 160, 90 );
    printerInfo.setFontSize( 11 );
   
    XInfoFileParser parser = new XInfoFileParser( project, "printers.xml" );
    parser.read( 0, printerInfo );

    XSvgImageMap imageMap = new XSvgImageMap();
    imageMap.setURL( getClass().getResource( "Floor5.svg" ) );
    imageMap.display();
   
    JFrame frame = new JFrame();
    frame.setSize( 800, 600 );
    frame.setLocation( 200, 100 );
    frame.getContentPane().add( imageMap );
    frame.setVisible( true );   
   
    JComponent glassPane = (JComponent)frame.getGlassPane();
    glassPane.setSize( 800, 600 );
    glassPane.setOpaque( false );
    glassPane.setLayout( null );
    glassPane.setVisible( true );
   
    XRolloverComponent rc1 = new XRolloverComponent( printerInfo );
    rc1.setBounds( 263, 232, 10, 10 );
    glassPane.add( rc1 );


The above block of code will display an XPrinterInfo componet when a rollover on the XRolloverComponent occurs.

2. Constructor


public XRolloverComponent( int x, int y, Component component )

Creates a new instance of XRolloverComponent taking the x and y coordinates and the Component to be displayed when there is a rollover event as parameters.

3. Methods


1. mouseEntered

public void mouseEntered(MouseEvent e)

If the mouse is detected entering the XRolloverComponent component, the component passed through the constructor is displayed.

2. mouseExited

public void mouseExited(MouseEvent e)

If the mouse is detected exiting the XRolloverComponent component, the component passed through the constructor is hidden.

There are no comments on this page. [Add comment]

Page was generated in 0.3336 seconds