Package client :: Package Dock :: Module Transforms :: Class AbstractTransform
[hide private]
[frames] | no frames]

Class AbstractTransform

source code


Overview

This class is essentially a virtual class, in that it really should never be instantiated, but rather further derived into more useful classes. The way in which it works is by creating a generic template that works for virtually all of the transformation fucntions. It does require that the derived versions of this class setup a number of member variables before they use the constructor of AbstractTransform.

Nested Classes [hide private]

Inherited from PyQt4.QtGui.QPaintDevice: PaintDeviceMetric

Instance Methods [hide private]
 
__init__(self, parent, bridge)
This constructor simply sets the type of the package to "Transformation", after which it runs the DockWidget's constructor.
source code
 
_addOptions(self)
The standard option for an Transform Dock Widget is the "Transform in Place" check box which allows users to designate where their output goes.
source code
 
_addCommands(self)
The stanard commands for the Transform Dock Widget are "Transform" and "Clear".
source code
 
_addDataSelection(self)
The purpose of the method is to create a place for any DockWidget to place the guts of the function.
source code
 
clear(self)
This method will clear all user modifiable fields.
source code
 
DefaultCheck(self)
This method has to deal with the preference (General Preferences) regarding where output of functions goes.
source code
 
DoubleClicked(self, attr=None)
This method will take an object and attempt to add it to the data selection of this dock widget.
source code
 
setOutput(self, state)
This method should be called whenever the "Transform in Place" checkbox's value changes.
source code
 
transform(self)
This method will attempt to execute the transformation on the data currently in the data selection.
source code
 
guessDefaults(self)
This function will first generate a list of regular expressions based on the input holders for the Transform Dock Widget.
source code

Inherited from PyQt4.QtGui.QWidget: acceptDrops, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, changeEvent, childAt, childEvent, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, connectNotify, contentsRect, contextMenuEvent, contextMenuPolicy, create, cursor, customEvent, destroy, devType, disconnectNotify, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, enabledChange, ensurePolished, enterEvent, event, find, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontChange, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabShortcut, handle, hasFocus, hasMouseTracking, height, heightForWidth, hide, hideEvent, inputContext, inputMethodEvent, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isEnabledToTLW, isFullScreen, isHidden, isLeftToRight, isMaximized, isMinimized, isModal, isRightToLeft, isTopLevel, isVisible, isVisibleTo, isWindow, isWindowModified, keyPressEvent, keyReleaseEvent, keyboardGrabber, languageChange, layout, layoutDirection, leaveEvent, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, moveEvent, nextInFocusChain, normalGeometry, overrideWindowFlags, overrideWindowState, paintEngine, paintEvent, palette, paletteChange, parentWidget, pos, raise_, receivers, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, repaint, resetInputContext, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, sender, setAcceptDrops, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedWidth, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setHidden, setInputContext, setLayout, setLayoutDirection, setMask, setMaximumHeight, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setShortcutAutoRepeat, setShortcutEnabled, setShown, setSizeIncrement, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, timerEvent, toolTip, topLevelWidget, underMouse, unsetCursor, unsetLayoutDirection, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, winId, window, windowActivationChange, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, x, x11Info, x11PictureHandle, y

Inherited from PyQt4.QtCore.QObject: blockSignals, children, connect, deleteLater, disconnect, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, eventFilter, findChild, findChildren, inherits, installEventFilter, isWidgetType, killTimer, metaObject, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setProperty, signalsBlocked, startTimer, thread, tr, trUtf8

Inherited from PyQt4.QtGui.QPaintDevice: depth, heightMM, logicalDpiX, logicalDpiY, numColors, paintingActive, physicalDpiX, physicalDpiY, widthMM

Inherited from sip.wrapper: __delattr__, __getattribute__, __new__, __setattr__

Inherited from object: __hash__, __reduce__, __reduce_ex__, __repr__, __str__

    Inherited from Widget.DockWidget
 
_addDescription(self)
This method provides the DockWidget with a consistent look for the function description
source code
 
_addHeader(self)
This method provides the DockWidget a consistent look for a header.
source code
 
_addModes(self)
The purpose of this method is to create a consistent look and feel for DockWidgets who need modes.
source code
Class Variables [hide private]

Inherited from PyQt4.QtGui.QPaintDevice: PdmDepth, PdmDpiX, PdmDpiY, PdmHeight, PdmHeightMM, PdmNumColors, PdmPhysicalDpiX, PdmPhysicalDpiY, PdmWidth, PdmWidthMM

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent, bridge)
(Constructor)

source code 

Overview

This constructor simply sets the type of the package to "Transformation", after which it runs the DockWidget's constructor.

Overrides: object.__init__

_addOptions(self)

source code 

Overview

The standard option for an Transform Dock Widget is the "Transform in Place" check box which allows users to designate where their output goes. When it is checked, the output will be directed to the List from which the input came from, otherwise they will be free variables.

Returns:
This function may return 1 of 2 things:
  1. QWidget
  2. None
Overrides: Widget.DockWidget._addOptions

_addCommands(self)

source code 

Overview

The stanard commands for the Transform Dock Widget are "Transform" and "Clear". "Transform" will actually execute the transformation if possible, and clear will remove any input data the user has already placed in the data holders.

Returns:
This function may return 1 of 2 things:
  1. QWidget
  2. None
Overrides: Widget.DockWidget._addCommands

_addDataSelection(self)

source code 

The purpose of the method is to create a place for any DockWidget to place the guts of the function.

Overview

This method has no default implementation since it would be unique for any DockWidget. There is no real default layout for any function's data selection. Bearing that in mind, this is the place where the actual data that the function intends to utilize should go. Utilize the Holders submodule for this.

Returns:
This function may return 1 of 2 things:
  1. QWidget
  2. None
Overrides: Widget.DockWidget._addDataSelection

clear(self)

source code 

Overview

This method will clear all user modifiable fields. For input fields this means returning them to None, while for Output fields it returns them to their default values. This is called on successful transform, as well as when the user clicks clear. Finally, it is also called before a data guess is performed, so that there is room for the guesses.

DefaultCheck(self)

source code 

Overview

This method has to deal with the preference (General Preferences) regarding where output of functions goes. This setting is stored as a "global" in the bridge, so this method checks the bridge to see whether or not to send output to the parent basin object, or to the free variable viewer.

DoubleClicked(self, attr=None)

source code 

Overview

This method will take an object and attempt to add it to the data selection of this dock widget. This can be slightly deceiving, as not just double clicking actions can invoke this method. Things such as GuessAttributes () will also invoke it since it simulates a double clicking action.

Parameters:

setOutput(self, state)

source code 

Overview

This method should be called whenever the "Transform in Place" checkbox's value changes. This means it should be hooked up to the QCheckBox's void stateChanged (int) signal. When it is checked, the parent list is required for the data selection, so it is enabled. Naturally, when the check box is unchecked, the parent list will be disabled. Regardless of which state the check box is in, when this method is called the guessDefaults method is always called.

Parameters:
  • state (int) - The state is the state of the check box when its signal void stateChanged (int) is called. We are only concerned with:
    1. The check box was unchecked.
    1. The check box was checked.

transform(self)

source code 

Overview

This method will attempt to execute the transformation on the data currently in the data selection. First it will make sure you are connected and already in autopx mode. Then, depending on whether the user has selected if they want their data to be transformed in place or not, it will send the correct ipython command to the ipython shell for execution. Afterwards, all of the data selection holders will be cleared.

guessDefaults(self)

source code 

Overview

This function will first generate a list of regular expressions based on the input holders for the Transform Dock Widget. From these regular expressions, it will run the Basin Object Tree items through the generated regular expressions, and on a match it will add it to the data selection layout.