本文整理汇总了Java中com.vlsolutions.swing.docking.TabbedDockableContainer类的典型用法代码示例。如果您正苦于以下问题:Java TabbedDockableContainer类的具体用法?Java TabbedDockableContainer怎么用?Java TabbedDockableContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TabbedDockableContainer类属于com.vlsolutions.swing.docking包,在下文中一共展示了TabbedDockableContainer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: storeFocusedDockables
import com.vlsolutions.swing.docking.TabbedDockableContainer; //导入依赖的package包/类
/**
* This method saves all tabs which are currently selected/visible.
*/
private void storeFocusedDockables() {
MainFrame mainFrame = RapidMinerGUI.getMainFrame();
if (mainFrame != null) {
focusedDockables = new ArrayList<>();
DockableState[] states = mainFrame.getDockingDesktop().getContext().getDockables();
List<TabbedDockableContainer> memorizedContainer = new ArrayList<>();
for (DockableState state : states) {
TabbedDockableContainer container = DockingUtilities.findTabbedDockableContainer(state.getDockable());
if (container != null) {
if (!memorizedContainer.contains(container)) {
focusedDockables.add(container.getSelectedDockable());
memorizedContainer.add(container);
}
}
}
}
}
示例2: applyFocusedDockables
import com.vlsolutions.swing.docking.TabbedDockableContainer; //导入依赖的package包/类
/**
* This method will make all tabs visible which were previously saved by
* {@link #storeFocusedDockables()}.
*/
private void applyFocusedDockables() {
for (Dockable dockable : focusedDockables) {
TabbedDockableContainer tabbedContainer = DockingUtilities.findTabbedDockableContainer(dockable);
if (tabbedContainer != null) {
tabbedContainer.setSelectedDockable(dockable);
}
}
}
示例3: scanDrop
import com.vlsolutions.swing.docking.TabbedDockableContainer; //导入依赖的package包/类
@Override
protected void scanDrop(DockEvent event, boolean drop) {
if (getParent() instanceof TabbedDockableContainer) {
if (drop) {
((DockDropEvent) event).rejectDrop();
} else {
((DockDragEvent) event).delegateDrag();
}
return;
}
if (event.getDragSource().getDockable() == dockable) {
if (drop) {
((DockDropEvent) event).rejectDrop();
} else {
((DockDragEvent) event).rejectDrag();
}
return;
}
if (event.getDragSource().getDockableContainer() instanceof TabbedDockableContainer) {
if (drop) {
((DockDropEvent) event).rejectDrop();
} else {
((DockDragEvent) event).rejectDrag();
}
return;
}
Rectangle bounds = getBounds();
DockGroup sourceGroup = event.getDragSource().getDockable().getDockKey().getDockGroup();
DockGroup destinationGroup = dockable.getDockKey().getDockGroup();
if (!DockGroup.areGroupsCompatible(destinationGroup, sourceGroup)) {
if (drop) {
((DockDropEvent) event).rejectDrop();
} else {
((DockDragEvent) event).rejectDrag();
}
return;
}
Dockable sourceDockable = event.getDragSource().getDockable();
DockableState.Location dockableLocation = sourceDockable.getDockKey().getLocation();
DockableState.Location viewLocation = dockable.getDockKey().getLocation();
if (drop) {
event.setDockingAction(new DockingActionCreateTabEvent(event.getDesktop(), sourceDockable, dockableLocation,
viewLocation, dockable, 0));
((DockDropEvent) event).acceptDrop(false);
desktop.createTab(dockable, event.getDragSource().getDockable(), 0, true);
} else {
Rectangle2D r2d = new Rectangle2D.Float(bounds.x, bounds.y, bounds.width, bounds.height);
event.setDockingAction(new DockingActionCreateTabEvent(event.getDesktop(), sourceDockable, dockableLocation,
viewLocation, dockable, 0));
if (r2d.equals(lastDropShape)) {
((DockDragEvent) event).acceptDrag(lastDropGeneralPath);
} else {
GeneralPath path = buildPathForTab(bounds);
;
lastDropShape = r2d;
lastDropGeneralPath = path;
((DockDragEvent) event).acceptDrag(lastDropGeneralPath);
}
}
}
示例4: scanDrop
import com.vlsolutions.swing.docking.TabbedDockableContainer; //导入依赖的package包/类
@Override
protected void scanDrop(DockEvent event, boolean drop){
if (getParent() instanceof TabbedDockableContainer){
if (drop){
((DockDropEvent) event).rejectDrop();
} else {
((DockDragEvent) event).delegateDrag();
}
return;
}
if (event.getDragSource().getDockable() == dockable) {
if (drop){
((DockDropEvent) event).rejectDrop();
} else {
((DockDragEvent) event).rejectDrag();
}
return;
}
if (event.getDragSource().getDockableContainer() instanceof TabbedDockableContainer) {
if (drop){
((DockDropEvent) event).rejectDrop();
} else {
((DockDragEvent) event).rejectDrag();
}
return;
}
Rectangle bounds = getBounds();
DockGroup sourceGroup = event.getDragSource().getDockable().getDockKey().getDockGroup();
DockGroup destinationGroup = dockable.getDockKey().getDockGroup();
if (!DockGroup.areGroupsCompatible(destinationGroup, sourceGroup)){
if (drop){
((DockDropEvent) event).rejectDrop();
} else {
((DockDragEvent) event).rejectDrag();
}
return;
}
Dockable sourceDockable = event.getDragSource().getDockable();
DockableState.Location dockableLocation = sourceDockable.getDockKey().getLocation();
DockableState.Location viewLocation = dockable.getDockKey().getLocation();
if (drop){
event.setDockingAction(new DockingActionCreateTabEvent(event.getDesktop(), sourceDockable, dockableLocation, viewLocation, dockable, 0));
((DockDropEvent) event).acceptDrop(false);
desktop.createTab(dockable, event.getDragSource().getDockable(), 0, true);
} else {
Rectangle2D r2d = new Rectangle2D.Float(bounds.x, bounds.y, bounds.width, bounds.height);
event.setDockingAction(new DockingActionCreateTabEvent(event.getDesktop(), sourceDockable, dockableLocation, viewLocation, dockable, 0));
if (r2d.equals(lastDropShape)) {
((DockDragEvent) event).acceptDrag(lastDropGeneralPath);
} else {
GeneralPath path = buildPathForTab(bounds);;
lastDropShape = r2d;
lastDropGeneralPath = path;
((DockDragEvent) event).acceptDrag(lastDropGeneralPath);
}
}
}