Package org.pdfsam.guiclient.dto

Examples of org.pdfsam.guiclient.dto.VisualPageListItem


  public VisualListRenderer() {
    setOpaque(true);
  }

  public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    VisualPageListItem item = (VisualPageListItem)value;
    currentZoomLevel = ((JVisualSelectionList)list).getCurrentZoomLevel();
    if(!item.isDeleted() || (item.isDeleted() && ((JVisualSelectionList)list).isDrawDeletedItems())){   
      if(item.getThumbnail()!= null){
        image = new ImageIcon(item.getThumbnail());
        setPreferredSize(getZoomedSize());
        drawRedCross = item.isDeleted();
      }
      String text = item.getPageNumber()+"";
      if(item.getPaperFormat()!=null && item.getPaperFormat().length()>0){
        text += " - ["+item.getPaperFormat()+"]";
      }
      setText(text);
      setHorizontalTextPosition(JLabel.CENTER);
      setVerticalTextPosition(JLabel.BOTTOM);
      setHorizontalAlignment(JLabel.CENTER);
View Full Code Here


  private static final long serialVersionUID = -1468591826451724954L;

  protected Vector<VisualPageListItem> data = new Vector<VisualPageListItem>();
   
  public Object getElementAt(int index) {
    VisualPageListItem retVal = null;
      if(index < data.size()){
        retVal = (VisualPageListItem)(data.get(index));
      }
        return retVal;
  }
View Full Code Here

     * @throws IndexOutOfBoundsException
     */
    public void rotateClockwiseElements(int[] indexes)throws IndexOutOfBoundsException{
        if (indexes.length>0 && indexes.length <= data.size()){
          for (int i=0; i<indexes.length; i++){
            VisualPageListItem item = data.get(indexes[i]);
            item.rotateClockwise();
         
          fireContentsChanged(this,indexes[0]-1, indexes[indexes.length-1]);
        }
    }
View Full Code Here

     * @throws IndexOutOfBoundsException
     */
    public void rotateAnticlockwiseElements(int[] indexes)throws IndexOutOfBoundsException{
        if (indexes.length>0 && indexes.length <= data.size()){
          for (int i=0; i<indexes.length; i++){
            VisualPageListItem item = data.get(indexes[i]);
            item.rotateAnticlockwise();
         
          fireContentsChanged(this,indexes[0]-1, indexes[indexes.length-1]);
        }
    }
View Full Code Here

     * Moves up a item at the given index fire to Listeners
     * @param index element index to move from the data source
     */
    public void moveUpIndex(int index)throws IndexOutOfBoundsException{
            if (index >= 1 && index < (data.size())){
              VisualPageListItem tmpElement = data.get(index);
                data.set(index, data.get((index-1)));
                data.set((index-1), tmpElement);
                fireContentsChanged(this,index-1, index);
            }
    }
View Full Code Here

     */
    public void moveUpIndexes(int[] indexes)throws IndexOutOfBoundsException{
        if (indexes.length > 0 && indexes.length < data.size()){
           //no move up if i'm selecting the first element of the table
           if (indexes[0] > 0){
             VisualPageListItem tmpElement = data.get(indexes[0]-1);
               for (int i=0; i<indexes.length; i++){   
                   if (indexes[i] > 0){
                           data.set(indexes[i]-1, data.get(indexes[i]));
                   }
               }
View Full Code Here

     * Moves down a item at the given index fire to Listeners
     * @param index element index to move from the data source
     */
    public void moveDownIndex(int index) throws IndexOutOfBoundsException{
            if (index >= 0 && index < (data.size()-1)){               
              VisualPageListItem tmpElement = data.get(index);
                data.set(index, data.get((index+1)));
                data.set((index+1), tmpElement);
                fireContentsChanged(this,index, index+1);
            }
    }
View Full Code Here

     */
    public void moveDownIndexes(int[] indexes)throws IndexOutOfBoundsException{
        if (indexes.length > 0 && indexes.length < data.size()){
            //no move down if i'm selecting the last element of the table
            if (indexes[indexes.length-1] < (data.size()-1)){
              VisualPageListItem tmpElement = data.get(indexes[indexes.length-1]+1);
                for (int i=(indexes.length-1); i>=0; i--){   
                    if (indexes[indexes.length-1] < (data.size()-1)){
                            data.set(indexes[i]+1, data.get(indexes[i]));
                    }
                }
View Full Code Here

  }

  public void mouseClicked(MouseEvent e) {
    if (e.getClickCount() == 2) {
      int index = thumbnailList.locationToIndex(e.getPoint());
      VisualPageListItem item = (VisualPageListItem) thumbnailList.getModel().getElementAt(index);
      PagePreviewOpener.getInstance().openPreview(item.getParentFileCanonicalPath(), item.getDocumentPassword(), item.getPageNumber());
    }
  } 
View Full Code Here

    menuItemPreview.setText(GettextResource.gettext(config.getI18nResourceBundle(),"Preview"));
    menuItemPreview.addMouseListener(new MouseAdapter() {
            public void mouseReleased(MouseEvent e) {
              int[] selection = thumbnailList.getSelectedIndices();
              if(selection!=null && selection.length==1){
                VisualPageListItem item = (VisualPageListItem) thumbnailList.getModel().getElementAt(selection[0]);
                PagePreviewOpener.getInstance().openPreview(item.getParentFileCanonicalPath(), item.getDocumentPassword(), item.getPageNumber());
              }
            }
        });
   
    if(showContextMenu){
View Full Code Here

TOP

Related Classes of org.pdfsam.guiclient.dto.VisualPageListItem

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.