Esempio n. 1
0
  @Override
  public void mousePressed(MouseEvent e) {
    /* clear all when 1. not meta down
     * 2. popup
     * 3. already selected
     *
     */
    if (!(e.isMetaDown()
        || (e.isPopupTrigger() && this.isSelected())
        || e.isShiftDown()
        || ((MartComponent) e.getSource()).isSelected())) {
      this.clearOthers((Component) e.getSource());
    }
    if (!this.isSelected() && e.getButton() == MouseEvent.BUTTON3) {
      this.clearOthers((Component) e.getSource());
    }

    McViewSourceGroup groupview =
        (McViewSourceGroup) McViews.getInstance().getView(IdwViewType.SOURCEGROUP);
    if (e.isShiftDown() && groupview.getLastpoint() != null) {
      this.clearOthers(this);
      List<MartComponent> mcs = groupview.getComponentsBetween(groupview.getLastpoint(), this);
      for (MartComponent mc : mcs) {
        mc.setSelected(true);
        mc.setBorder(BorderFactory.createLineBorder(Color.RED));
      }
    } else groupview.setLastpoint(this);
    this.setSelected(true);
    this.setBorder(BorderFactory.createLineBorder(Color.RED));

    if (e.isPopupTrigger()) {
      this.handleRightClick(e);
    } else if (e.getClickCount() == 2) {
      List<Mart> martList = new ArrayList<Mart>();
      martList.add(((MartComponent) e.getSource()).getMart());
      // added cols orders to a new PtModel
      ArrayList<Integer> cols = new ArrayList<Integer>();
      cols.add(PartitionUtils.DATASETNAME);
      cols.add(PartitionUtils.DISPLAYNAME);
      cols.add(PartitionUtils.CONNECTION);
      cols.add(PartitionUtils.DATABASE);
      cols.add(PartitionUtils.SCHEMA);
      cols.add(PartitionUtils.HIDE);
      cols.add(PartitionUtils.KEY);
      new DatasourceDialog(martList, cols, !this.getMart().getSourceContainer().isGrouped());
    }
    this.revalidate();
  }
Esempio n. 2
0
 @Override
 public void mouseExited(MouseEvent e) {
   McViewPortal portalView = ((McViewPortal) McViews.getInstance().getView(IdwViewType.PORTAL));
   this.setBackground(this.getParent().getBackground());
   /*this.setCursor(new Cursor(Cursor.HAND_CURSOR));
   Set<ConfigComponent> cclist = portalView
   		.getComponentListByMart(this.getMart());
   for (ConfigComponent cc : cclist) {
   	cc.setBackground(this.getParent().getBackground());
   }
   Map<MartPointer,Set<Mart>> configMartMap = portalView.getMPMartMap();
   for(Map.Entry<MartPointer, Set<Mart>> entry: configMartMap.entrySet()) {
   	if(entry.getValue().contains(this.getMart())) {
   		ConfigComponent cc = portalView.getComponentByMartPointer(entry.getKey());
   		cc.setBackground(this.getParent().getBackground());
   	}
   }*/
   GuiContainerPanel gcp = portalView.getSelectedGcPanel();
   gcp.setHighlight(null);
 }