当前位置: 首页>>代码示例>>Java>>正文


Java BeanProperty类代码示例

本文整理汇总了Java中org.jdesktop.beansbinding.BeanProperty的典型用法代码示例。如果您正苦于以下问题:Java BeanProperty类的具体用法?Java BeanProperty怎么用?Java BeanProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BeanProperty类属于org.jdesktop.beansbinding包,在下文中一共展示了BeanProperty类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: HighlighterControl

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
public HighlighterControl() {
    matte = new MattePainter(PaintUtils.setAlpha(base, 125));
    tableValueBasedHighlighter = new RelativePainterHighlighter(matte);
    table.addHighlighter(tableValueBasedHighlighter);
    treeTable.addHighlighter(tableValueBasedHighlighter);

    valueBasedHighlighter = new RelativePainterHighlighter(matte);
    list.addHighlighter(valueBasedHighlighter);
    tree.addHighlighter(valueBasedHighlighter);
    
    setSpreadColumns(false);
    
    BindingGroup group = new BindingGroup();
    group.addBinding(Bindings.createAutoBinding(READ, 
            extendedMarkerBox, BeanProperty.create("selected"),
            this, BeanProperty.create("spreadColumns")));
    group.bind();
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:19,代码来源:HighlighterExtDemo.java

示例2: bind

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void bind() {
    
    BindingGroup group = new BindingGroup();
    group.addBinding(Bindings.createAutoBinding(READ, 
            datePicker, BeanProperty.create("date"),
            dateEchoField, BeanProperty.create("value")
    ));

    group.addBinding(Bindings.createAutoBinding(READ,
        interactivity, BeanProperty.create("selected"),
        datePicker, BeanProperty.create("enabled")
    ));
    
    group.addBinding(Bindings.createAutoBinding(READ,
        editability, BeanProperty.create("selected"),
        datePicker, BeanProperty.create("editable")
    ));
    
    Binding b = Bindings.createAutoBinding(READ,
        orientation, BeanProperty.create("selected"),
        datePicker, BeanProperty.create("componentOrientation"));
    b.setConverter(new ComponentOrientationConverter());
    group.addBinding(b);
    group.bind();
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:27,代码来源:DatePickerDemo.java

示例3: start

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
/**
     * Callback method for demo loader. 
     */
    public void start() {
        if (oscarModel.getRowCount() != 0) return;
        //<snip>Use SwingWorker to asynchronously load the data
        // create SwingWorker which will load the data on a separate thread
        SwingWorker<?, ?> loader = new OscarDataLoader(
                XTableDemo.class.getResource("resources/oscars.xml"), oscarModel);
        
        // display progress bar while data loads
        progressBar = new JProgressBar();
        statusBarLeft.add(progressBar);
        // bind the worker's progress notification to the progressBar
        // and the worker's state notification to this
        BindingGroup group = new BindingGroup();
        group.addBinding(Bindings.createAutoBinding(READ, 
                loader, BeanProperty.create("progress"),
                progressBar, BeanProperty.create("value")));
        group.addBinding(Bindings.createAutoBinding(READ, 
                loader, BeanProperty.create("state"),
                this, BeanProperty.create("loadState")));
        group.bind();
        loader.execute();
//        </snip>
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:27,代码来源:XTableDemo.java

示例4: bindSelection

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void bindSelection(Object... components) {
    painterDemos.setCellRenderer(new DefaultTreeRenderer(
            DisplayValues.DISPLAY_INFO_DESCRIPTION)); 
    Converter<?, ?> painterConverter = new DisplayInfoConverter<Painter>();
    BindingGroup group = new BindingGroup();
    for (int i = 0; i < components.length; i++) {
        BeanProperty p = BeanProperty.create(
                i == 0 ? "backgroundPainter" : "painter");
        Binding b = Bindings.createAutoBinding(READ,
                painterDemos, BeanProperty.create("selectedElement_UNWRAP_NODE"),
                components[i], p);
        b.setConverter(painterConverter);
        group.addBinding(b);
        
    }
    group.bind();
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:19,代码来源:PainterDemo.java

示例5: updateAreaBindings

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void updateAreaBindings() {
    if (areaEnabled) {
        areaGroup = new BindingGroup();
        areaGroup.addBinding(Bindings.createAutoBinding(READ, 
                paintStretchedBox, BeanProperty.create("selected"),
                painter, BeanProperty.create("paintStretched")));
        areaGroup.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ, 
                styleBox, BeanProperty.create("selectedItem"),
                painter, BeanProperty.create("style")));
        Binding effectsBinding = (Bindings.createAutoBinding(READ, 
                effectBox, BeanProperty.create("selectedItem"),
                painter, BeanProperty.create("areaEffects")));
        effectsBinding.setConverter(new DisplayInfoArrayConverter(AreaEffect.class));
        areaGroup.addBinding(effectsBinding);
        Binding borderWidthBinding = (Bindings.createAutoBinding(READ, 
                borderWidthSlider, BeanProperty.create("value"),
                painter, BeanProperty.create("borderWidth")));
        borderWidthBinding.setConverter(PainterDemoUtils.SLIDER_TO_FLOAT);
        areaGroup.addBinding(borderWidthBinding);
        areaGroup.bind();
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:24,代码来源:PainterDemo.java

示例6: updateBaseBindings

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
/**
 * 
 */
@SuppressWarnings("unchecked")
private void updateBaseBindings() {
    if (baseEnabled) {
        baseGroup = new BindingGroup();
        baseGroup.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ, 
                interpolationBox, BeanProperty.create("selectedItem"),
                painter, BeanProperty.create("interpolation")));
        baseGroup.addBinding(Bindings.createAutoBinding(READ, 
                visibleBox, BeanProperty.create("selected"),
                painter, BeanProperty.create("visible")));
        baseGroup.addBinding(Bindings.createAutoBinding(READ, 
                antialiasBox, BeanProperty.create("selected"),
                painter, BeanProperty.create("antialiasing")));
        Binding filterBinding = (Bindings.createAutoBinding(READ, 
                filterBox, BeanProperty.create("selectedItem"),
                painter, BeanProperty.create("filters")));
        filterBinding.setConverter(new DisplayInfoArrayConverter(BufferedImageOp.class));
        baseGroup.addBinding(filterBinding);
        baseGroup.bind();
        
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:26,代码来源:PainterDemo.java

示例7: updateAlignBindings

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
/**
 * 
 */
@SuppressWarnings("unchecked")
private void updateAlignBindings() {
    if (alignEnabled) {
        alignGroup = new BindingGroup();
        alignGroup.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ, 
                horizontalAlignmentBox, BeanProperty.create("selectedItem"),
                painter, BeanProperty.create("horizontalAlignment")));
        alignGroup.addBinding(Bindings.createAutoBinding(READ, 
                verticalAlignmentBox, BeanProperty.create("selectedItem"),
                painter, BeanProperty.create("verticalAlignment")));
        alignGroup.addBinding(Bindings.createAutoBinding(READ, 
                fillHorizontal, BeanProperty.create("selected"),
                painter, BeanProperty.create("fillHorizontal")));
        alignGroup.addBinding(Bindings.createAutoBinding(READ, 
                fillVertical, BeanProperty.create("selected"),
                painter, BeanProperty.create("fillVertical")));
        Binding insetBinding = (Bindings.createAutoBinding(READ, 
                insetSlider, BeanProperty.create("value"),
                painter, BeanProperty.create("insets")));
        insetBinding.setConverter(PainterDemoUtils.SLIDER_TO_INSETS);
        alignGroup.addBinding(insetBinding);
        
        alignGroup.bind();
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:29,代码来源:PainterDemo.java

示例8: bind

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void bind() {
    Binding b = Bindings.createAutoBinding(READ,
            speedSlider, BeanProperty.create("value"),
            label, BeanProperty.create("delay"));
    b.setConverter(new FactorConverter<Integer>(10));
    b.bind();
    
    Bindings.createAutoBinding(READ,
            pointsSlider, BeanProperty.create("value"),
            label, ELProperty.create("${busyPainter.points}")).bind();
    
    Bindings.createAutoBinding(READ,
            trailSlider, BeanProperty.create("value"),
            label, ELProperty.create("${busyPainter.trailLength}")).bind();
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:17,代码来源:BusyLabelDemo.java

示例9: bindLabelFor

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
/**
 * <p>
 * Creates a binding for the specified {@code label} that tracks the {@code enabled} and {@code
 * visible} states of its {@#link JLabel#setLabelFor(Component) labelFor} property. If
 * no component is associated with the label or the associated component is removed, the label
 * will retain its current enabled and visible states.
 * </p>
 * <p>
 * If a component is supplied, then this method will also set the label-for association.
 * </p>
 * 
 * @param label
 *            the label to bind
 * @param c
 *            the component to associate with the label; may be {@code null}
 * @throws NullPointerException
 *             if {@code label} is {@code null}
 */
public static void bindLabelFor(JLabel label, Component c) {
    if (label.getClientProperty(LABEL_FOR_BINDING_KEY) == null) {
        BindingGroup bg = new BindingGroup();
        
        //use the ternary operator to ensure that we always check valid properties
        //we get the same effect using ${labelFor.enabled} but that results in log
        //warnings when the labelFor property is null/empty.
        bg.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, label,
                ELProperty.create("${empty labelFor ? enabled : labelFor.enabled}"), label,
                BeanProperty.create("enabled")));
        bg.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, label,
                ELProperty.create("${empty labelFor ? visible : labelFor.visible}"), label,
                BeanProperty.create("visible")));
        bg.bind();
        
        label.putClientProperty(LABEL_FOR_BINDING_KEY, bg);
    }
    
    label.setLabelFor(c);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:39,代码来源:LabelHandler.java

示例10: initDataBindings

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
/**
 * Inits the data bindings.
 */
protected void initDataBindings() {
  JTableBinding<Movie, List<Movie>, JTable> jTableBinding = SwingBindings.createJTableBinding(UpdateStrategy.READ_WRITE, moviesInSet, tableMovies);
  //
  BeanProperty<Movie, String> movieBeanProperty = BeanProperty.create("title");
  jTableBinding.addColumnBinding(movieBeanProperty).setEditable(false); // $NON-NLS-1$
  //
  BeanProperty<Movie, String> movieBeanProperty_1 = BeanProperty.create("year");
  jTableBinding.addColumnBinding(movieBeanProperty_1).setEditable(false); // $NON-NLS-1$
  //
  BeanProperty<Movie, Boolean> movieBeanProperty_2 = BeanProperty.create("watched");
  jTableBinding.addColumnBinding(movieBeanProperty_2).setEditable(false).setColumnClass(Boolean.class); // $NON-NLS-1$
  //
  jTableBinding.setEditable(false);
  jTableBinding.bind();
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:19,代码来源:MovieSetEditorDialog.java

示例11: initDataBindings

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
protected void initDataBindings() {
  BeanProperty<MovieSelectionModel, Integer> movieSelectionModelBeanProperty = BeanProperty.create("selectedMovie.dateAdded.date");
  BeanProperty<JLabel, String> jLabelBeanProperty = BeanProperty.create("text");
  AutoBinding<MovieSelectionModel, Integer, JLabel, String> autoBinding = Bindings.createAutoBinding(UpdateStrategy.READ, movieSelectionModel,
      movieSelectionModelBeanProperty, lblDateAdded, jLabelBeanProperty);
  autoBinding.bind();
  //
  BeanProperty<MovieSelectionModel, Integer> movieSelectionModelBeanProperty_2 = BeanProperty.create("selectedMovie.dateAdded.day");
  AutoBinding<MovieSelectionModel, Integer, JLabel, String> autoBinding_2 = Bindings.createAutoBinding(UpdateStrategy.READ, movieSelectionModel,
      movieSelectionModelBeanProperty_2, lblDateAdded, jLabelBeanProperty);
  autoBinding_2.bind();
  //
  BeanProperty<MovieSelectionModel, String> movieSelectionModelBeanProperty_3 = BeanProperty.create("selectedMovie.dateAddedAsString");
  AutoBinding<MovieSelectionModel, String, JLabel, String> autoBinding_3 = Bindings.createAutoBinding(UpdateStrategy.READ, movieSelectionModel,
      movieSelectionModelBeanProperty_3, lblDateAdded, jLabelBeanProperty);
  autoBinding_3.bind();
  //
  BeanProperty<MovieSelectionModel, String> movieSelectionModelBeanProperty_13 = BeanProperty.create("selectedMovie.path");
  AutoBinding<MovieSelectionModel, String, JLabel, String> autoBinding_19 = Bindings.createAutoBinding(UpdateStrategy.READ, movieSelectionModel,
      movieSelectionModelBeanProperty_13, lblMoviePath, jLabelBeanProperty);
  autoBinding_19.bind();
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:23,代码来源:MovieMediaFilesPanel.java

示例12: initDataBindings

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
protected void initDataBindings() {
  BeanProperty<Settings, List<String>> settingsBeanProperty_5 = BeanProperty.create("videoFileType");
  JListBinding<String, Settings, JList> jListBinding_1 = SwingBindings.createJListBinding(UpdateStrategy.READ_WRITE, settings,
      settingsBeanProperty_5, listVideoFiletypes);
  jListBinding_1.bind();
  //
  BeanProperty<Settings, List<String>> settingsBeanProperty_6 = BeanProperty.create("subtitleFileType");
  JListBinding<String, Settings, JList> jListBinding_2 = SwingBindings.createJListBinding(UpdateStrategy.READ_WRITE, settings,
      settingsBeanProperty_6, listSubtitleFiletypes);
  jListBinding_2.bind();
  //
  BeanProperty<Settings, List<String>> settingsBeanProperty_10 = BeanProperty.create("titlePrefix");
  JListBinding<String, Settings, JList> jListBinding = SwingBindings.createJListBinding(UpdateStrategy.READ_WRITE, settings,
      settingsBeanProperty_10, listSortPrefixes);
  jListBinding.bind();
  //
  BeanProperty<Settings, List<String>> settingsBeanProperty_11 = BeanProperty.create("audioFileType");
  JListBinding<String, Settings, JList> jListBinding_3 = SwingBindings.createJListBinding(UpdateStrategy.READ_WRITE, settings,
      settingsBeanProperty_11, listAudioFiletypes);
  jListBinding_3.bind();
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:22,代码来源:FileTypesSettingsPanel.java

示例13: creaWidget

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
private void creaWidget(Scene scene, Point point) {

        this.setLayout(LayoutFactory.createHorizontalFlowLayout());
        MyGradientLabelWidget gradientWidget = creaHeaderWidget(scene);
        ImageWidget imageWidget = new ImageWidget(scene, ImageUtilities.loadImage(Costanti.ICONA_CONSTANT));
        gradientWidget.addChild(imageWidget);
        LabelWidget constantWidget = new LabelWidget(scene, "");
        constantWidget.setVerticalAlignment(LabelWidget.VerticalAlignment.CENTER);
        this.addChild(gradientWidget);
        this.addChild(constantWidget);
        this.setPreferredLocation(new Point(point.x - 1, point.y - 1));
        settaBordoConstant();

        Binding bindingConst = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ, caratteristicheWidget, ELProperty.create("${costante}"), constantWidget, BeanProperty.create("label"));
        bindingConst.bind();
        
        this.setOpaque(true);

    }
 
开发者ID:dbunibas,项目名称:spicy,代码行数:20,代码来源:ConstantWidget.java

示例14: initDataBindings

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
protected void initDataBindings()
{
	BeanProperty<FindFociModel, List<String>> findFociModelBeanProperty = BeanProperty.create("imageList");
	JComboBoxBinding<String, FindFociModel, JComboBox> jComboBinding = SwingBindings.createJComboBoxBinding(
			UpdateStrategy.READ, model, findFociModelBeanProperty, comboImageList);
	jComboBinding.bind();
	//
	BeanProperty<FindFociModel, String> findFociModelBeanProperty_1 = BeanProperty.create("selectedImage");
	BeanProperty<JComboBox, Object> jComboBoxBeanProperty = BeanProperty.create("selectedItem");
	AutoBinding<FindFociModel, String, JComboBox, Object> autoBinding = Bindings.createAutoBinding(
			UpdateStrategy.READ_WRITE, model, findFociModelBeanProperty_1, comboImageList, jComboBoxBeanProperty);
	autoBinding.bind();
	//
	BeanProperty<JButton, Boolean> jButtonBeanProperty = BeanProperty.create("enabled");
	AutoBinding<FindFociModel, List<String>, JButton, Boolean> autoBinding_1 = Bindings.createAutoBinding(
			UpdateStrategy.READ, model, findFociModelBeanProperty, btnRun, jButtonBeanProperty);
	autoBinding_1.setConverter(new ValidImagesConverter());
	autoBinding_1.bind();
}
 
开发者ID:aherbert,项目名称:GDSC,代码行数:21,代码来源:OptimiserView.java

示例15: bind

import org.jdesktop.beansbinding.BeanProperty; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void bind() {
    // list properties
    // <snip> JXlist sorting
    // enable auto-create RowSorter
    list.setAutoCreateRowSorter(true);
    list.setModel(Contributors.getContributorListModel());
    //</snip>
    
    // control combos
    comparatorCombo.setModel(createComparators());
    highlighterCombo.setModel(createRolloverHighlighters());
    
    BindingGroup group = new BindingGroup();
    group.addBinding(Bindings.createAutoBinding(READ, 
            rolloverEnabledBox, BeanProperty.create("selected"),
            this, BeanProperty.create("rolloverEnabled")));
    Binding comparatorBinding = Bindings.createAutoBinding(READ, 
            comparatorCombo, BeanProperty.create("selectedItem"),
            this, BeanProperty.create("comparator"));
    comparatorBinding.setConverter(new DisplayInfoConverter<Comparator<?>>());
    group.addBinding(comparatorBinding);

    Binding rolloverBinding = Bindings.createAutoBinding(READ, 
            highlighterCombo, BeanProperty.create("selectedItem"),
            this, BeanProperty.create("rolloverHighlighter"));
    rolloverBinding.setConverter(new DisplayInfoConverter<Highlighter>());
    group.addBinding(rolloverBinding);
    
    group.bind();
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:32,代码来源:XListDemo.java


注:本文中的org.jdesktop.beansbinding.BeanProperty类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。