Examples of AbstractButton


Examples of javax.swing.AbstractButton

    final JTableHeader      th;
    final TableCellRenderer    tcr;
    final JScrollPane      scroll;
    final JTextArea        lbTextArea;
    final Box          b;
    final AbstractButton    ggPlus, ggMinus;

    tab      = new JPanel();
    lay      = new BorderLayout();
    tab.setLayout( lay );
   
    lbTextArea  = new JTextArea( getResourceString( KEY_INFOTEXT[ id ]));
    lbTextArea.setEditable( false );
    lbTextArea.setBackground( null );
    lbTextArea.setColumns( 32 );
    lbTextArea.setLineWrap( true );
    lbTextArea.setWrapStyleWord( true );
    tab.add( lbTextArea, BorderLayout.NORTH );
    lbTextArea.setBorder( BorderFactory.createEmptyBorder( 8, 2, 8, 2 ));
   
    tm      = new TableModel( id );
    stm      = new SortedTableModel( tm );
    table    = new JTable( stm );
    th      = table.getTableHeader();
    stm.setTableHeader( th );
    th.setReorderingAllowed( false );
    th.setResizingAllowed( true );
    table.setAutoResizeMode( JTable.AUTO_RESIZE_OFF );
    table.setCellSelectionEnabled( true );
    table.setColumnSelectionAllowed( false );
    table.setDragEnabled( true );
    table.setShowGrid( true );
    table.setGridColor( Color.lightGray );
    table.setSelectionMode( ListSelectionModel.SINGLE_INTERVAL_SELECTION );
    table.setTransferHandler( new MapTransferHandler( id ));
   
    stm.setSortedColumn( 0, SortedTableModel.ASCENDING );

    tcr      = new MappingRenderer();
    setColumnRenderersAndWidths( table, stm, tcr );

    scroll    = new JScrollPane( table, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                        ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS );
   
    tab.add( scroll, BorderLayout.CENTER );
   
    b      = Box.createHorizontalBox();
    ggPlus    = new ModificationButton( ModificationButton.SHAPE_PLUS );
    ggMinus    = new ModificationButton( ModificationButton.SHAPE_MINUS );
    ggMinus.setEnabled( false );
    ggPlus.addActionListener( new ActionListener() {
      public void actionPerformed( ActionEvent e )
      {
//        int row = table.getSelectedRow() + table.getSelectedRowCount();
//        if( row <= 0 ) row = collConfigs[ ID ].size();
        final int modelIndex = collConfigs[ id ].size();
View Full Code Here

Examples of javax.swing.AbstractButton

  @Override
  public void initAction() {
    super.initAction();

    final AbstractButton but = interaction.getButton();
    action.setPencil(instrument.pencil);

    if(but==instrument.fillColButton)
      action.setProperty(ShapeProperties.COLOUR_FILLING);
    else if(but==instrument.gradEndColButton)
View Full Code Here

Examples of javax.swing.AbstractButton

    else action = null;
  }

  @Override
  public boolean isConditionRespected() {
    final AbstractButton but = interaction.getButton();
    return (but==instrument.fillColButton || but==instrument.gradEndColButton || but==instrument.gradStartColButton ||
        but==instrument.hatchColButton) && instrument.pencil.isActivated();
  }
View Full Code Here

Examples of javax.swing.AbstractButton

  @Override
  public void initAction() {
    super.initAction();

    final AbstractButton but = interaction.getButton();
    action.setGroup(instrument.pencil.canvas().getDrawing().getSelection().duplicateDeep(false));

    if(but==instrument.fillColButton)
      action.setProperty(ShapeProperties.COLOUR_FILLING);
    else if(but==instrument.gradEndColButton)
View Full Code Here

Examples of javax.swing.AbstractButton

    else action = null;
  }

  @Override
  public boolean isConditionRespected() {
    final AbstractButton but = interaction.getButton();
    return (but==instrument.fillColButton || but==instrument.gradEndColButton || but==instrument.gradStartColButton ||
        but==instrument.hatchColButton) && instrument.hand.isActivated();
  }
View Full Code Here

Examples of javax.swing.AbstractButton

  }


  @Override
  public void initAction() {
    final AbstractButton ab = interaction.getButton();

    action.setActivateFirst(false);

    if(ab!=instrument.textB)
      action.addInstrumentToInactivate(instrument.pencil.textSetter());
View Full Code Here

Examples of javax.swing.AbstractButton

  public void addComponent(final Component comp) {
    toolbar.add(comp, null, toolbar.getComponentCount()-1);
    buttonsFrame.pack();

    if(comp instanceof AbstractButton) {
      final AbstractButton ab = (AbstractButton) comp;
      ab.addActionListener(this);
    }

    attachAddedComponent(comp);
  }
View Full Code Here

Examples of javax.swing.AbstractButton

    super(ins, ModifyPencilParameter.class);
  }

  @Override
  public void initAction() {
    final AbstractButton ab = interaction.getButton();

    action.setProperty(ShapeProperties.TEXT_POSITION);
    action.setPencil(instrument.pencil);

    if(instrument.blButton==ab) action.setValue(ITextProp.TextPosition.BOT_LEFT);
View Full Code Here

Examples of javax.swing.AbstractButton

    else action.setValue(ITextProp.TextPosition.TOP_RIGHT);
  }

  @Override
  public boolean isConditionRespected() {
    final AbstractButton ab = interaction.getButton();
    return instrument.pencil.isActivated() && (instrument.tButton==ab || instrument.tlButton==ab || instrument.centreButton==ab ||
        instrument.trButton==ab || instrument.bButton==ab || instrument.blButton==ab || instrument.brButton==ab ||
        instrument.lButton==ab || instrument.rButton==ab);
  }
View Full Code Here

Examples of javax.swing.AbstractButton

    super(ins, ModifyShapeProperty.class);
  }

  @Override
  public void initAction() {
    final AbstractButton ab = interaction.getButton();

    action.setGroup(instrument.hand.canvas().getDrawing().getSelection().duplicateDeep(false));
    action.setProperty(ShapeProperties.TEXT_POSITION);

    if(instrument.bButton==ab) action.setValue(ITextProp.TextPosition.BOT);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.