亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? attributedisplay.java

?? JAVA開源LDAP瀏覽器jxplorer的源碼!
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
package com.ca.directory.jxplorer.viewer;

import javax.swing.*;
import java.lang.reflect.*;

import java.awt.*;
import java.awt.print.*;
import java.util.*;
import java.util.logging.Logger;
import java.util.logging.Level;
import java.io.*;

import com.ca.directory.jxplorer.*;
import com.ca.commons.cbutil.*;
import com.ca.commons.naming.*;

import javax.naming.directory.*;
import javax.naming.NamingException;
import javax.swing.event.ChangeListener;
import javax.swing.event.ChangeEvent;

/**
 *    <p>AttributeDisplay holds a variety of display and editing
 *    classes, as well as a simple toolbar to allow switching
 *    between these.  The main one is an HTML template displaying
 *    class, but there are (will be) also attribute editing and
 *    template editing classes...</p>
 *
 *    <p>Note that this class is *not* thread safe.</p>
 */

public class AttributeDisplay extends JTabbedPane
    implements DataSink, Printable
{
    /**
     *    The HTML editor is always in position 1 (if present)
     */
     
    public static final int HTMLRENDERER = 1;
    
    /**
     *    The Table editor is always in position 2 (if present)
     */
    
    public static final int EDITOR = 2;

    /**
     *   The scroll pane that holds the main view object
     */
      
    protected JScrollPane  viewHolder;
    
    /**
     *  The main view panel.  This is what holds the various editors.
     */
     
    protected JPanel       view;
    
    
    //protected JToolBar     toolBar;

    /**
     *    the source of directory data for all editors
     */
     
    protected DataSource           dataSource;        
    
    /**
     *    the currently viewed entry (may be null)
     */
     
    protected DXEntry              entry = null;                   

    /**
     *    The editor currently being displayed to the user.
     *    This is updated every time the user tabs to a new
     *    editor, or a different editor is loaded.
     */
     
    protected PluggableEditor      currentEditor;

    /**
     *    The default html editor, that is usually available, and which
     *    displays html template files
     */
     
    protected HTMLTemplateDisplay  templateDisplay;                
    
    /**
     *    The default table editor, that is usually available, and displays
     *    entry data as a grid of strings.  Binary data may be edited using
     *    special 'attribute editors'.
     */
     
    protected TableAttributeEditor tableDisplay;                   

    /**
     *    A convenience link to schema.
     */
     
//XXX?    protected DirContext schemaInfo;                               // used to discover schema

    /**
     *    A convenience link to the global JX properties list.
     */
     
    protected Properties myProperties;

    /**
     *    The printing preferences used to print the currently visible entry editor.
     */

    private Properties printprefs = new Properties();    

    /**
     *    A hashtable of all the editors that have ever been used to display an
     *    entry in the current JX session.  When an entry is loaded, these are 
     *    checked first to determine whether an editor already exists, and if it
     *    does, it is re-used.
     */
     
    protected Hashtable editors = new Hashtable();
    
    /**
     *    a list containing the currently displayed editors
     */

    protected Vector activeEditors = new Vector(8);  

    /**
     *    the parent frame displaying this object
     */
     
    protected JFrame owner;                          


    protected String oldOCSig = null;                // a concatenation of the last used object classes.

    /** A local copy of the JX component, to pass on to pluggable editors */

    private JMenuBar registerMenu = null;

    /** A local copy of the JX component, to pass on to pluggable editors */

    private JToolBar registerButtons = null;

    /** A local copy of the JX component, to pass on to pluggable editors */

    private JTree registerTree = null;

    /** A local copy of the JX component, to pass on to pluggable editors */

    private JPopupMenu registerTreeMenu = null;

    /** A local copy of the JX component, to pass on to pluggable editors */

    private JFrame registerJX = null;

    /**
     *  A local copy of the special class loader used to load the plugable
     *  editors.
     */
     
    protected ClassLoader myLoader = null;            // the class loader used for reading pluggable editors from zip/jar files.

    /**
     *  A local copy of the special resource loader used to load the plugable
     *  editors and their associated resource files.
     */
     
    protected CBResourceLoader resourceLoader = null; // the resource loader used for reading HTML templates from zip/jar files.

    /**
     *    All Plugins must have this package prefix.  Usually it is com.ca.directory.jxplorer.viewer,
     *    but it <i>can</i> be reset in the configuration.
     */
     
    public static String PACKAGEPREFIX = "com.ca.directory.jxplorer.viewer.";

    public static void setPackagePrefix(String prefix) { PACKAGEPREFIX = prefix; }

    public static String getPackagePrefix() { return PACKAGEPREFIX; }

    // Do we need an alternative 'BASESPREFIX' variable for when PACKAGEPREFIX is changed?
    // public static String BASEPREFIX = "com.ca.directory.jxplorer.viewer.";

    /**
     *     A utility constant - this is used in the editor hashtable to indicate
     *     that no pluggable editor has been found, and that there is no need
     *     to use the resource loader to look again.
     */
     
    protected static final String NONE = "none";

    /**
     *    A temporary copy of a component that is to be printed, used by the
     *    print thread mechanism to pass an editor image around.
     */
     
    private Component printComponent = null;

    /**
     *    Every time a tab is added or deleted, or a new tab is selected, a
     *    change event is triggered.  Sometimes we'd like to ignore these
     *    while we're getting our tabs sorted out (i.e. when we're adding
     *    and deleting large numbers of tabs) and this flags that such
     *    changes should be ignored.
     *
     */
     
    protected boolean ignoreChangeEvents = false;

    private static Logger log = Logger.getLogger(AttributeDisplay.class.getName());

    /**
     *    The constructor for AttributeDisplay requires information
     *    about default file directories and urls.  These are passed
     *    in via a Properties object, that should contain values for
     *    'dir.templates', 'dir.htmldocs', and 'dir.local'.
     *    @param props list of defaults for file and url locations.
     *    @param owner the parent frame, used for gui sanity and L&F propogation
     *    @param resourceLoader the resource loader used to load HTML templates from zip/jar files
     */

    public AttributeDisplay(Properties props, JFrame owner, CBResourceLoader resourceLoader) 
    {
        super();


        myProperties = props;

        if (myProperties.containsKey("plugins.package"))
        {
            setPackagePrefix(myProperties.getProperty("plugins.package"));
            log.fine("SETTING PLUGIN PREFIX TO: " + PACKAGEPREFIX);
        }
        else
            log.fine("PLUGIN PREFIX UNCHANGED: " + PACKAGEPREFIX);

        this.resourceLoader = resourceLoader;

        this.owner = owner;

            initHTMLEditor();
            initTableEditor();
            addEditor(templateDisplay);

            /**
             *  This change listener is *intended* to listen for user initiated tab
             *  changes, rather than programmatic changes to the editor tabs (which
             *  are expected to look after themselves)
             */

            addChangeListener( new ChangeListener()
            {
                public void stateChanged(ChangeEvent e)
                {
                    if (ignoreChangeEvents)   // sometimes when we're messing around we can fire heaps of
                        return;          // change events - and there's no point paying attention to 'em.

                    int index = getSelectedIndex();

                    if (index >= 0 && activeEditors.size() > index && activeEditors.get(index) != null)
                    {
                        setCurrentEditor((PluggableEditor)activeEditors.get(index));
                    }
                    else    // should never happen (ROTFL)
                    {
                        log.warning("internal error - unable to find editor # " + index + " in Attribute Display");
                    }
                }
            });
    }

    /**
     *    This specifies the class loader used to load plugin editors.
     *    (This may not be known when an AttributeDisplay object is first 
     *    created, at which time only the default system class loader is used).
     */
     
    public void registerClassLoader(ClassLoader loader)
    {
        myLoader = loader;
        if (tableDisplay == null)
        	initTableEditor();
        	
        tableDisplay.registerClassLoader(loader);
    }

    /**
     * delay initialising the html editor until we need it, or it is loaded by
     * a background thread.
     */

    protected synchronized void initHTMLEditor()
    {
        if (templateDisplay != null) return;

        templateDisplay = new HTMLTemplateDisplay(this, myProperties, resourceLoader);
        
        /*
         *    HTML editor is placed in the hashtable associated with the object
         *    class "top".  Since *all* directory entries must have object class
         *    "top", this is the equivalent of saying the editor may be used for
         *    all object classes.
         */
         
        //editors.put("top", templateDisplay);        
        
        // Set the html editor to be the current default editor.
        
        currentEditor = templateDisplay;
    }

    /**
     * delay initialising the table editor until we need it, or it is loaded by
     * a background thread.
     */

    protected synchronized void initTableEditor()
    {
        if (tableDisplay != null) return;

        tableDisplay = new TableAttributeEditor(owner);
        
        /*
         *    HTML editor is placed in the hashtable associated with the object
         *    class "top".  Since *all* directory entries must have object class
         *    "top", this is the equivalent of saying the editor may be used for
         *    all object classes.
         */
         
        //editors.put("top", tableDisplay);           // can be used for all entries
    }

   /**
    * The method @print@ must be implemented for @Printable@ interface.
    * Parameters are supplied by system.
    *
    */
    //(Magic Irina Spell...!)
    
    public int print(Graphics g, PageFormat pf, int pageIndex) throws PrinterException
    {
        //Component printMe = getPrintComponent();

        Graphics2D g2 = (Graphics2D)g;
        g2.setColor(Color.black);    //set default foreground color to black

        //for faster printing, turn off double buffering
        //RepaintManager.currentManager(this).setDoubleBufferingEnabled(false);

        Dimension d = printComponent.getSize();    //get size of document
        double panelWidth  = d.width;    //width in pixels
        double panelHeight = d.height;   //height in pixels
        double pageHeight = pf.getImageableHeight();   //height of printer page
        double pageWidth  = pf.getImageableWidth();    //width of printer page
        double scale = pageWidth/panelWidth;
        int totalNumPages = (int)Math.ceil(scale * panelHeight / pageHeight);

        //make sure we don't print empty pages
        if(pageIndex >= totalNumPages)
        {
            return Printable.NO_SUCH_PAGE;
        }

        //shift Graphic to line up with beginning of print-imageable region
        g2.translate(pf.getImageableX(), pf.getImageableY());
        
        //shift Graphic to line up with beginning of next page to print
        g2.translate(0f, -pageIndex*pageHeight);
        
        //scale the page so the width fits...
        g2.scale(scale, scale);
        
        // PRINT IT!
        printComponent.paint(g2);
        
        return Printable.PAGE_EXISTS;
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品嫩草影院com| 777xxx欧美| 韩国v欧美v亚洲v日本v| 国产精品一级片| 欧美mv日韩mv国产网站| 国产精选一区二区三区| 欧美高清一级片在线观看| 成人精品视频网站| 国产精品福利一区二区| 色婷婷av一区二区三区软件 | 麻豆视频观看网址久久| 日韩免费电影一区| 丰满亚洲少妇av| 一区二区三区日韩欧美| 91精品国产入口在线| 久久66热re国产| 国产精品视频线看| 欧美午夜精品理论片a级按摩| 天堂久久一区二区三区| 精品久久久久久久久久久久久久久 | 亚洲h在线观看| 日韩欧美中文一区二区| 国产成人精品一区二区三区四区 | 毛片一区二区三区| 国产欧美日韩在线观看| 91久久香蕉国产日韩欧美9色| 男女视频一区二区| 国产欧美一区二区三区沐欲| 欧美中文字幕不卡| 国产一区欧美一区| 亚洲国产综合人成综合网站| 精品国产免费久久| 91亚洲精华国产精华精华液| 日韩福利电影在线| 国产目拍亚洲精品99久久精品| 91电影在线观看| 国产精品911| 热久久一区二区| 亚洲色图色小说| 久久久噜噜噜久久人人看 | 91麻豆swag| 极品美女销魂一区二区三区 | 日韩手机在线导航| 91麻豆国产精品久久| 国产在线精品一区二区三区不卡 | 一区二区三区蜜桃网| 欧美性猛交一区二区三区精品| 欧美熟乱第一页| 亚洲sss视频在线视频| 国产精品欧美久久久久一区二区| 在线成人av网站| 99国产精品久久久久久久久久| 激情六月婷婷久久| 日韩激情视频网站| 亚洲免费观看高清完整| 日韩精品中文字幕一区| 欧美午夜寂寞影院| 97se亚洲国产综合自在线| 久久99精品一区二区三区 | 欧美日韩一区二区三区不卡| 国产成人精品影院| 欧美国产综合一区二区| 中文字幕人成不卡一区| 欧美麻豆精品久久久久久| 欧美午夜精品一区二区三区| 亚洲伊人色欲综合网| 欧美国产激情二区三区| 久久久久久一二三区| 精品国产亚洲在线| 精品少妇一区二区三区日产乱码 | 久久精品国产久精国产爱| 亚洲一区二区三区视频在线播放| 亚洲男人的天堂网| 亚洲视频电影在线| 亚洲色图19p| 亚洲乱码中文字幕综合| 中文字幕一区二区三区不卡| 亚洲欧美综合色| 综合久久综合久久| 亚洲猫色日本管| 一区二区三区欧美在线观看| 一区二区免费看| 亚洲国产婷婷综合在线精品| 婷婷六月综合网| 免费一级欧美片在线观看| 久久国产精品露脸对白| 国产米奇在线777精品观看| 久久国产日韩欧美精品| 国产美女娇喘av呻吟久久| 成人午夜视频在线观看| 99久久婷婷国产| 色狠狠综合天天综合综合| 欧美专区亚洲专区| 日韩欧美视频一区| 国产午夜亚洲精品羞羞网站| 亚洲国产精品t66y| 亚洲女人的天堂| 天堂在线一区二区| 精品综合免费视频观看| 国产成人午夜高潮毛片| 91视频一区二区| 在线播放中文一区| 久久在线观看免费| 亚洲另类在线制服丝袜| 午夜精品久久久久久久久久久| 免费黄网站欧美| 成人中文字幕电影| 91久久一区二区| 久久综合久久综合久久综合| 国产精品久久久久久亚洲伦| 午夜精品一区二区三区免费视频| 日本午夜精品一区二区三区电影| 国产精品亚洲第一| 欧美性感一类影片在线播放| 精品美女一区二区三区| 中文字幕在线免费不卡| 丝袜美腿成人在线| av成人免费在线观看| 日韩一区二区三区电影在线观看| 国产精品网站在线播放| 青椒成人免费视频| 色综合久久久久综合体桃花网| 欧美一级片在线看| 亚洲欧美一区二区三区孕妇| 青青青爽久久午夜综合久久午夜| 大胆亚洲人体视频| 欧美一区中文字幕| 亚洲欧洲国产日本综合| 日韩精品国产精品| 91免费小视频| 久久久久久久性| 美女一区二区在线观看| 91精品1区2区| 国产蜜臀av在线一区二区三区| 性久久久久久久| 91蜜桃婷婷狠狠久久综合9色| 91精品免费在线| 亚洲一区二区三区四区在线免费观看| 国产精品一级在线| 欧美一区二区三区影视| 亚洲综合免费观看高清完整版| 高清国产一区二区| 精品国产人成亚洲区| 丝袜美腿成人在线| 精品视频在线视频| 亚洲人一二三区| 成人免费黄色大片| 欧美国产精品一区| 国产一区二区三区在线观看免费| 欧美一区二区三区视频在线观看| 亚洲午夜一区二区三区| 97久久超碰国产精品| 中文字幕精品一区二区三区精品| 国产综合一区二区| 精品国产乱码久久久久久图片| 日日摸夜夜添夜夜添亚洲女人| 色香色香欲天天天影视综合网| 亚洲国产精品成人综合| 国产精品自产自拍| 久久久久国色av免费看影院| 美女视频免费一区| 日韩精品中午字幕| 精品亚洲国内自在自线福利| 日韩一区二区三区电影在线观看| 日本欧美一区二区三区乱码| 欧美丰满一区二区免费视频 | 麻豆91在线播放免费| 日韩视频永久免费| 久久精品999| 精品久久久久久最新网址| 国产一区二区导航在线播放| 久久中文字幕电影| 成人国产亚洲欧美成人综合网| 中文字幕欧美激情| 91女人视频在线观看| 亚洲自拍偷拍综合| 欧美精品九九99久久| 人人精品人人爱| 久久日韩精品一区二区五区| 国产成人av网站| 中文字幕综合网| 欧美绝品在线观看成人午夜影视 | 久久精品久久99精品久久| 2020国产精品| 99精品国产一区二区三区不卡| 亚洲日本一区二区| 欧美日本一区二区三区| 久久99国产精品麻豆| 国产三级精品三级| 97精品电影院| 日韩电影一区二区三区四区| 精品日本一线二线三线不卡| 盗摄精品av一区二区三区| 亚洲精品日韩一| 日韩精品一区二区三区三区免费 | 91视频你懂的| 日本一区中文字幕| 日本一区二区三区dvd视频在线| 9i在线看片成人免费| 亚洲第四色夜色|