/** Changes the thumb position to the specified grid component */
  void update(GridComponent gc) {
    DesignerDragSource dds =
        (DesignerDragSource) JETARegistry.lookup(DesignerDragSource.COMPONENT_ID);
    if (dds != null && dds != this && dds.isDragging()) {
      return;
    }

    if (isPaintMargin() && !m_dragging && m_compsrc.isSelectionTool()) {
      m_gc = gc;
      if (gc != null) {
        GridView parentview = gc.getParentView();
        if (parentview == m_view) {
          m_gc = null;
        } else {
          if (parentview != null) {
            Insets insets = parentview.getInsets();
            int col_offset = gc.getColumn() + gc.getColumnSpan() - 1;

            Point pt =
                javax.swing.SwingUtilities.convertPoint(
                    parentview,
                    parentview.getColumnOrgX(col_offset)
                        + parentview.getColumnWidth(col_offset)
                        + insets.left,
                    0,
                    this);
            m_xpos = pt.x;
          }
        }
      }
      repaint();
    }
  }
 static {
   try {
     ResourceLoader loader = (ResourceLoader) JETARegistry.lookup(ResourceLoader.COMPONENT_ID);
     m_column_thumb = loader.loadImage("jeta.resources/images/forms/thumb_vertical.png");
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
  /**
   * Determines if the mouse is pressed over a control button. If so, handles the event accordingly.
   */
  private boolean handleControlButton(MouseEvent e) {
    if (e.getID() == MouseEvent.MOUSE_PRESSED) {
      java.awt.Container btnpanel = m_comp.getButtonPanel();
      JComponent btn = m_comp.getExpandButton();
      Point local_pt =
          SwingUtilities.convertPoint((Component) e.getSource(), e.getPoint(), btnpanel);

      Rectangle rect = btn.getBounds();
      if (rect.contains(local_pt)) {
        m_comp.setGridViewVisible(!m_comp.isGridViewVisible());
        return true;
      }

      btn = m_comp.getEditButton();
      rect = btn.getBounds();
      if (rect.contains(local_pt)) {
        FormManager fmgr = (FormManager) JETARegistry.lookup(FormManager.COMPONENT_ID);
        fmgr.showForm(m_comp.getId());
        return true;
      }

      btn = m_comp.getGridButton();
      rect = btn.getBounds();
      if (rect.contains(local_pt)) {
        GridView view = m_comp.getChildView();
        boolean bvis = !view.isGridVisible();
        if (bvis) {
          m_comp.setGridViewVisible(bvis);
        } else {
          view.setGridVisible(bvis);
        }
        return true;
      }
    }

    return false;
  }