Search

 

Edition: Futurama Website/Futurama Export/Futurama Webservice

Module: Futurama Editor

User: Developer

Prerequisites

- Working with objects

 

Description

Objects that are located in a certain location in the Document Explorer can easily be copied or moved to another location. This page describes the possible methods of copying/cutting and pasting objects using the Document Explorer and the Design window.

Copy and Paste

There are a couple of ways to copy and paste objects:

  • By using the Copy and Paste buttons in the toolbar, the shortcuts CTRL+C and CTRL+V or the contextmenu in either the Document Explorer or the Design window.
  • In the Design window select the object that needs to be copied. Keep the mousebutton pressed and drag the object to the desired location in the Document Explorer. Before releasing the mouse button press the CTRL button and then release the mousebutton.

Pasting is only possible when a suitable location is selected. This is typically a Document, a Node, an XMLBuilder etc. If an improper location is selected, such as a Formula, then the Paste option will be disabled.

It is also possible to copy an object that produces a value (like a Fixed, Reference, Formula) and paste it straight into a Formula. This can't be done using method two mentioned above however.

Example

Description

In this example the several methods of copying and pasting objects are shown. In this example a Futurama application is used which can be downloaded here.

Steps

  • Open the Futurama Editor.
  • Open the Futurama Document "MyFirstDocument".
  • In either the Document Explorer or the Design window select the Fixed 'A'.
  • Do a right click and select Copy, press CTRL+C or select the 'standard' Copy icon in the toolbar.
  • Select the Node 'Results' and do a right click and select Paste, press CTRL-V or select the 'standard' Paste icon in the toolbar.

The result is that the Node 'Results' will contain a Fixed 'A'.

  • In the Document Explorer select the Node 'Calculations'.
  • In the Design window select the Fixed 'B'.
  • While keeping the mouse button pressed drag 'B' to the Node 'Results'. Notice that when moving with the mouse over objects like the Fixeds and Formulas that a 'not allowed' symbol appears. This indicates that Pasting is not an option.
  • Move the mouse to the Node 'Results', notice that the 'not allowed' icon disappears.
  • Press CTRL and release the mouse button.

The result is that the Node 'Results' will now also contain a Fixed 'B'.

Absolute and relative references

When copying an object which has Determinants (i.e. References to other objects) it is relevant whether these References are absolute or relative. An absolute Reference denotes that the complete path to an object is used i.e. from the root-Document on. A relative Reference denotes that the path to an object is used starting from the object where the Reference is made. When copying a Formula the absolute References will pose no problem for the complete path to the referred object remains the same. The relative References can, however, become invalid. This is demonstrated in the Example below. These invalid References then have to be repaired.

Example

Description

In this example the behaviour of the References in an object are shown after copying the object to another location. In this example a Futurama application is used which can be downloaded here.

Steps

  • Open the Futurama Editor.
  • Open the Futurama Document "MyFirstDocument".
  • Open the Formula 'Sum' (by clicking the 'Text' property in the Properties Window).

It can be seen that the Reference to 'A' is absolute for the path start at the root (i.e. the Document). The Reference to 'B' is relative and refers to an object 'B' which is located in the same Node.

  • Copy 'Sum' to the new Node 'Results'

It can now be seen that the Reference to 'B' has become invalid because there now is no object 'B' in the Node 'Results'. Solving this error can be done in several ways. One way is to make the Reference to 'B' in the original Formula 'Sum' absolute analogue to the Reference to 'A'. Another way is to redefine the Reference to 'B'. A third way is to copy 'B' to the Node 'Results' as well.

Drag and drop (Cut and Paste)

To drag an object from one location to another is straightforward. In the Design window select the object that needs to be moved. Keep the mousebutton pressed and drag the object to the desired location in the Document Explorer. When the mousebutton is released the object is placed in the new location. Of course it is also possible to use the Cut icon in the toolbar or use CTRL+X. The remarks in the paragraph "Copy and Paste" apply here as well.

Note that when cutting and pasting an object any relative References will become absolute.

Example

Description

In this example an object is moved to another Node by simply dragging and dropping it. In this example a Futurama application is used which can be downloaded here.

Steps

  • Open the Futurama Editor.
  • Open the Futurama Document "MyFirstDocument".
  • In the Design window select the Formula 'Sum'.
  • While keeping the mouse button pressed drag 'Sum' to the Node 'Results'.
  • Move the mouse to the Node 'Results' and release the mousebutton.

Note that 'Sum' remains valid. The Reference to Fixed 'B' has become absolute.

Creating a Reference

Creating a Reference can be done in two ways.

  • By creating a new Reference in the Design window followed by defining the Reference.
  • Select the location where the Reference has to be created in the Document Explorer. Then select the object to which a Reference has to be made in the Document Explorer and keep the mousebutton pressed. Then drag the object to the Design window. The result will be a Reference with the same name as the object to which the Reference is created.

Example

Description

In this example an object is moved to another Node by simply dragging and dropping it. In this example a Futurama application is used which can be downloaded here.

Steps

  • Open the Futurama Editor.
  • Open the Futurama Document "MyFirstDocument".
  • Select the Node 'Results'.
  • Select the Formula 'Sum', keep the mousebutton pressed and drag the object to the Design window.

The result will be a Reference 'Sum' in the Node 'Results' to the Formula 'Sum' in the Node 'Calculations'.

Moving objects

Inside a Node objects are arranged in a certain order. The order of objects is relevant for example when a WebPage is created. The objects then are shown based on the sequence in the Design Window/Document Explorer. To create a certain logic in this order it is often necessary to rearrange this order by moving objects. In the Editor this can be done rather easily in a couple of ways:

  • In the Document Explorer the buttons Move Up and Move Down can be used. These are available in the toolbar as well as in the contextmenu.
  • In the Design window these buttons are also available but here it is also possible to select an object and, while keeping the mousebutton pressed, to move it up and down freely.

The methods mentioned above are available only when moving objects within their current level be it in a Node, an XMLBuilder etc. 

Feedback

If you have any questions about this subject or if you want to provide us feedback please send us an e-mail.

Updated: 2013-08-08