Package org.foo.shape

Examples of org.foo.shape.SimpleShape


   * @param name The name of the <tt>SimpleShape</tt> to retrieve.
   * @return The corresponding <tt>SimpleShape</tt> instance if available or
   *         <tt>null</tt>.
   **/
  public SimpleShape getShape(String name) {
    SimpleShape shape = (SimpleShape) m_shapes.get(name);
    if (shape == null) {
      return m_defaultShape;
    } else {
      return shape;
    }
View Full Code Here


   *
   * @param g2 The graphics object used for painting.
   * @param p The position to paint the triangle.
   **/
  public void draw(Graphics2D g2, Point p) {
    SimpleShape shape = m_shapeRef.get();
   
    // If this is a proxy shape, use it to draw the shape.
    if (shape != null) {
        // Draw the shape.
        shape.draw(g2, p);
        // If everything was successful, then simply return.
        return;
    }

    // If the proxied shape could not be drawn for any reason or if
View Full Code Here

   **/
  protected void paintComponent(Graphics g) {
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    SimpleShape shape = m_frame.getShape(m_shapeName);
    shape.draw(g2, new Point(getWidth() / 2, getHeight() / 2));
  }
View Full Code Here

   * @param name The name of the <tt>SimpleShape</tt> to retrieve.
   * @return The corresponding <tt>SimpleShape</tt> instance if available or
   *         <tt>null</tt>.
   **/
  public SimpleShape getShape(String name) {
    SimpleShape shape = (SimpleShape) m_shapes.get(name);
    if (shape == null) {
      return m_defaultShape;
    } else {
      return shape;
    }
View Full Code Here

   *
   * @param ref The service reference of the added service.
   * @return The service object to be used by the tracker.
   **/
  public Object addingService(ServiceReference ref) {
    SimpleShape shape = new DefaultShape(m_context, ref);
    processShapeOnEventThread(ADDED, ref, shape);
    return shape;
  }
View Full Code Here

   **/
  protected void paintComponent(Graphics g) {
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    SimpleShape shape = m_frame.getShape(m_shapeName);
    shape.setColor(getForeground());
    shape.draw(g2, new Point(getWidth() / 2, getHeight() / 2));
  }
View Full Code Here

   * @param name The name of the <tt>SimpleShape</tt> to retrieve.
   * @return The corresponding <tt>SimpleShape</tt> instance if available or
   *         <tt>null</tt>.
   **/
  public SimpleShape getShape(String name) {
    SimpleShape shape = (SimpleShape) m_shapes.get(name);
    if (shape == null) {
      return m_defaultShape;
    } else {
      return shape;
    }
View Full Code Here

   *
   * @param g2 The graphics object used for painting.
   * @param p The position to paint the triangle.
   **/
  public void draw(Graphics2D g2, Point p) {
    SimpleShape shape = m_shapeRef.get();
   
    // If this is a proxy shape, use it to draw the shape.
    if (shape != null) {
        // Draw the shape.
        shape.draw(g2, p);
        // If everything was successful, then simply return.
        return;
    }

    // If the proxied shape could not be drawn for any reason or if
View Full Code Here

    }
    g2.drawImage(m_icon.getImage(), 0, 0, null);
  }

  public Icon getIcon() {
    SimpleShape shape = m_shapeRef.get();
    if ( shape != null ) {
      return shape.getIcon();
    }
   
    if (m_icon == null) {
      try {
        m_icon = new ImageIcon(this.getClass().getResource("underc.png"));
View Full Code Here

   * @param name The name of the <tt>SimpleShape</tt> to retrieve.
   * @return The corresponding <tt>SimpleShape</tt> instance if available or
   *         <tt>null</tt>.
   **/
  public SimpleShape getShape(String name) {
    SimpleShape shape = (SimpleShape) m_shapes.get(name);
    if (shape == null) {
      return m_defaultShape;
    } else {
      return shape;
    }
View Full Code Here

TOP

Related Classes of org.foo.shape.SimpleShape

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.