Search Results

Search found 25747 results on 1030 pages for 'tree view'.

Page 3/1030 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • iPad issue with a modal view: modal view label null after view controller is created

    - by iPhone Guy
    This is a weird issue. I have created a view controller with a nib file for my modal view. On that view there is a label, number and text view. When I create the view from the source view, I tried to set the label, but it shows that the label is null (0x0). Kinda weird... Any suggestions? Now lets look at the code (I put all of the code here because that shows more than I can just explain): The modal view controller - in IB the label is connected to the UILabel object: @implementation ModalViewController @synthesize delegate; @synthesize goalLabel, goalText, goalNumber; // Done button clicked - (void)dismissView:(id)sender { // Call the delegate to dismiss the modal view if ([delegate respondsToSelector:@selector(didDismissModalView: newText:)]) { NSNumber *tmpNum = goalNumber; NSString *tmpString = [[NSString alloc] initWithString:[goalText text]]; [delegate didDismissModalView:tmpNum newText:tmpString]; [tmpNum release]; [tmpString release]; } } - (void)cancelView:(id)sender { // Call the delegate to dismiss the modal view if ([delegate respondsToSelector:@selector(didCancelModalView)]) [delegate didCancelModalView]; } -(void) setLabelText:(NSString *)text { [goalLabel setText:text]; } /* // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { // Custom initialization } return self; } */ -(void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; // bring up the keyboard.... [goalText becomeFirstResponder]; } // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; // set the current goal number to -1 so we know none was set goalNumber = [NSNumber numberWithInt: -1]; // Override the right button to show a Done button // which is used to dismiss the modal view self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismissView:)] autorelease]; // and now for the cancel button self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelView:)] autorelease]; self.navigationItem.title = @"Add/Update Goals"; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Overriden to allow any orientation. return YES; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [super dealloc]; } @end And here is where the view controller is created, variables set, and displayed: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // put a checkmark.... UITableViewCell *tmpCell = [tableView cellForRowAtIndexPath:indexPath]; [tmpCell setAccessoryType:UITableViewCellAccessoryCheckmark]; // this is where the popup is gonna popup! // ===> HEre We Go! // Create the modal view controller ModalViewController *mdvc = [[ModalViewController alloc] initWithNibName:@"ModalDetailView" bundle:nil]; // We are the delegate responsible for dismissing the modal view [mdvc setDelegate:self]; // Create a Navigation controller UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:mdvc]; // set the modal view type navController.modalPresentationStyle = UIModalPresentationFormSheet; // set the label for all of the goals.... if (indexPath.section == 0 && indexPath.row == 0) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Long Term Goal 1:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:1]]; } if (indexPath.section == 0 && indexPath.row == 1) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Long Term Goal 2:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:2]]; } if (indexPath.section == 0 && indexPath.row == 2) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Long Term Goal 3:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:3]]; } if (indexPath.section == 0 && indexPath.row == 3) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Long Term Goal 4:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:4]]; } if (indexPath.section == 1 && indexPath.row == 0) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Short Term Goal 1:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:5]]; } if (indexPath.section == 1 && indexPath.row == 1) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Short Term Goal 2:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:6]]; } if (indexPath.section == 1 && indexPath.row == 2) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Short Term Goal 3:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:7]]; } if (indexPath.section == 1 && indexPath.row == 3) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Short Term Goal 4:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:8]]; } // show the navigation controller modally [self presentModalViewController:navController animated:YES]; // Clean up resources [navController release]; [mdvc release]; // ==> Ah... we are done... }

    Read the article

  • Problem with building tree bottom up

    - by Esmond
    Hi, I have problems building a binary tree from the bottom up. THe input of the tree would be internal nodes of the trees with the children of this node being the leaves of the eventual tree. So initially if the tree is empty the root would be the first internal node. Afterwards, The next internal node to be added would be the new root(NR), with the old root(OR) being one of the child of NR. And so on. The problem i have is that whenever i add a NR, the children of the OR seems to be lost when i do a inOrder traversal. This is proven to be the case when i do a getSize() call which returns the same number of nodes before and after addNode(Tree,Node) Any help with resolving this problem is appreciated edited with the inclusion of node class code. both tree and node classes have the addChild methods because i'm not very sure where to put them for it to be appropriated. any comments on this would be appreciated too. The code is as follows: import java.util.*; public class Tree { Node root; int size; public Tree() { root = null; } public Tree(Node root) { this.root = root; } public static void setChild(Node parent, Node child, double weight) throws ItemNotFoundException { if (parent.child1 != null && parent.child2 != null) { throw new ItemNotFoundException("This Node already has 2 children"); } else if (parent.child1 != null) { parent.child2 = child; child.parent = parent; parent.c2Weight = weight; } else { parent.child1 = child; child.parent = parent; parent.c1Weight = weight; } } public static void setChild1(Node parent, Node child) { parent.child1 = child; child.parent = parent; } public static void setChild2(Node parent, Node child) { parent.child2 = child; child.parent = parent; } public static Tree addNode(Tree tree, Node node) throws ItemNotFoundException { Tree tree1; if (tree.root == null) { tree.root = node; } else if (tree.root.getSeq().equals(node.getChild1().getSeq()) || tree.root.getSeq().equals(node.getChild2().getSeq())) { Node oldRoot = tree.root; oldRoot.setParent(node); tree.root = node; } else { //form a disjoint tree and merge the 2 trees tree1 = new Tree(node); tree = mergeTree(tree, tree1); } System.out.print("addNode2 = "); if(tree.root != null ) { Tree.inOrder(tree.root); } System.out.println(); return tree; } public static Tree mergeTree(Tree tree, Tree tree1) { String root = "root"; Node node = new Node(root); tree.root.setParent(node); tree1.root.setParent(node); tree.root = node; return tree; } public static int getSize(Node root) { if (root != null) { return 1 + getSize(root.child1) + getSize(root.child2); } else { return 0; } } public static boolean isEmpty(Tree Tree) { return Tree.root == null; } public static void inOrder(Node root) { if (root != null) { inOrder(root.child1); System.out.print(root.sequence + " "); inOrder(root.child2); } } } public class Node { Node child1; Node child2; Node parent; double c1Weight; double c2Weight; String sequence; boolean isInternal; public Node(String seq) { sequence = seq; child1 = null; c1Weight = 0; child2 = null; c2Weight = 0; parent = null; isInternal = false; } public boolean hasChild() { if (this.child1 == null && this.child2 == null) { this.isInternal = false; return isInternal; } else { this.isInternal = true; return isInternal; } } public String getSeq() throws ItemNotFoundException { if (this.sequence == null) { throw new ItemNotFoundException("No such node"); } else { return this.sequence; } } public void setChild(Node child, double weight) throws ItemNotFoundException { if (this.child1 != null && this.child2 != null) { throw new ItemNotFoundException("This Node already has 2 children"); } else if (this.child1 != null) { this.child2 = child; this.c2Weight = weight; } else { this.child1 = child; this.c1Weight = weight; } } public static void setChild1(Node parent, Node child) { parent.child1 = child; child.parent = parent; } public static void setChild2(Node parent, Node child) { parent.child2 = child; child.parent = parent; } public void setParent(Node parent){ this.parent = parent; } public Node getParent() throws ItemNotFoundException { if (this.parent == null) { throw new ItemNotFoundException("This Node has no parent"); } else { return this.parent; } } public Node getChild1() throws ItemNotFoundException { if (this.child1 == null) { throw new ItemNotFoundException("There is no child1"); } else { return this.child1; } } public Node getChild2() throws ItemNotFoundException { if (this.child2 == null) { throw new ItemNotFoundException("There is no child2"); } else { return this.child2; } } }

    Read the article

  • Behaviour tree code example?

    - by jokoon
    http://altdevblogaday.org/2011/02/24/introduction-to-behavior-trees/ Obviously the most interesting article I found on this website. What do you think about it ? It lacks some code example, don't you know any ? I also read that state machines are not very flexible compared to behaviour trees... On top of that I'm not sure if there is a true link between state machines and the state pattern... is there ?

    Read the article

  • How to procedurally (create) grow an artistic (2D) tree in real-time (L-System?).

    - by lalan
    Recently I programmed an L-system module, It got me interested further. I am a Plants vs Zombies junkie as well, really liked the concept of Tree of Wisdom. Would love to create similar procedural art just for fun and learn more. Question: How should I approach the process of creating an artistic tree (2d perhaps with fixed camera/perspective) dynamically? Ideally I would like to start with a plant (only a stem with a leaf) and grow it dynamically using some influence (input/user action) over its structure. These influences may result in different type of branching, curves in branches, its spread, location of fruits, color of flowers, etc. Want it to be really full of life/spirit. :) Plants vs Zombies: Tree of wisdom It would be great to dynamically grow a similar tree, but with lot more variation and animations happening. My Background: Student / Programmer, have used few game engines (Ogre3d, cocos2d, unity). Haven't really programmed directly using openGL, trying to fix that :). I am ready to spend considerable time, Please let me know about the APIs? and how would an expert like you would take on this problem? Why 2D? I think it's easier to solve the problem only considering 2 dimensions. Artistic inspirations: Only the tree, with fruits and leaves, without the shrubs at the bottom The large tree (visible branches, green leaves, flowers, fruits, etc) on the left, behind monkey. PixelJunk's Eden (Art style inspiration). Procedurally Generated Apple Tree using Fractals Please let me know if it was easy for you to understand the question, I may elaborate further. I hope a discussion of various approach would be helpful for everyone. You guys are awesome.

    Read the article

  • Upgrade tree to 1.6?

    - by Pureferret
    I'm trying to upgrade my version of tree to 1.6 on ubuntu 12.04. I've d'loaded, ran make and make install in the terminal using the sudo command. ~/tree-1.6.0$ sudo make make: Nothing to be done for `all'. I've already run sudo make here ~/tree-1.6.0$ sudo make install install -d /usr/bin install -d /usr/man/man1 if [ -e tree ]; then \ install -s tree /usr/bin/tree; \ fi install doc/tree.1 /usr/man/man1/tree.1 What's this output though? It's not updated. I've checked the man page, and -du doesn't work. How am I supposed to update tree if not via the terminal?

    Read the article

  • Configure spanning tree from HP to Cisco hardware

    - by Tim Brigham
    I have three switches I'd like to configure in a loop - a Cisco stack (3750s) and two HP 2900 series. Each is connected to the next with a 10 gig backplane of one form or another. How do I configure the spanning tree on these systems to make this function correctly? From the documents I've looked at it looks like I need to set both sets of hardware to use MST mode but I'm not sure past that point. The trunking, etc is all set up as needed. HP Switch 1 A4 connected to Cisco 1/0/1. HP Switch 2 B2 connected to Cisco 2/0/1. HP Switch 1 A2 connected to HP Switch 2 A1. HP Switch 1 show spanning-tree Multiple Spanning Tree (MST) Information STP Enabled : Yes Force Version : MSTP-operation IST Mapped VLANs : 1-4094 Switch MAC Address : 0021f7-126580 Switch Priority : 32768 Max Age : 20 Max Hops : 20 Forward Delay : 15 Topology Change Count : 352,485 Time Since Last Change : 2 secs CST Root MAC Address : 0018ba-c74268 CST Root Priority : 1 CST Root Path Cost : 200000 CST Root Port : 1 IST Regional Root MAC Address : 0021f7-126580 IST Regional Root Priority : 32768 IST Regional Root Path Cost : 0 IST Remaining Hops : 20 Root Guard Ports : TCN Guard Ports : BPDU Protected Ports : BPDU Filtered Ports : PVST Protected Ports : PVST Filtered Ports : | Prio | Designated Hello Port Type | Cost rity State | Bridge Time PtP Edge ----- --------- + --------- ---- ---------- + ------------- ---- --- ---- ... A1 | Auto 128 Disabled | A2 10GbE-CX4 | 2000 128 Forwarding | 0021f7-126580 2 Yes No A3 10GbE-CX4 | Auto 128 Disabled | A4 10GbE-SR | 2000 128 Forwarding | 0021f7-126580 2 Yes No HP Switch 2 show spanning-tree Multiple Spanning Tree (MST) Information STP Enabled : Yes Force Version : MSTP-operation IST Mapped VLANs : 1-4094 Switch MAC Address : 0024a8-cd6000 Switch Priority : 32768 Max Age : 20 Max Hops : 20 Forward Delay : 15 Topology Change Count : 19,623 Time Since Last Change : 32 secs CST Root MAC Address : 0018ba-c74268 CST Root Priority : 1 CST Root Path Cost : 202000 CST Root Port : A1 IST Regional Root MAC Address : 0024a8-cd6000 IST Regional Root Priority : 32768 IST Regional Root Path Cost : 0 IST Remaining Hops : 20 Root Guard Ports : TCN Guard Ports : BPDU Protected Ports : BPDU Filtered Ports : PVST Protected Ports : PVST Filtered Ports : | Prio | Designated Hello Port Type | Cost rity State | Bridge Time PtP Edge ----- --------- + --------- ---- ---------- + ------------- ---- --- ---- ... A1 10GbE-CX4 | 2000 128 Forwarding | 0021f7-126580 2 Yes No A2 10GbE-CX4 | Auto 128 Disabled | B1 SFP+SR | 2000 128 Blocking | a44c11-a67c80 2 Yes No B2 | Auto 128 Disabled | Cisco Stack 1 show spanning-tree ... (additional VLANs) VLAN0100 Spanning tree enabled protocol ieee Root ID Priority 1 Address 0018.bac7.426e Cost 2 Port 107 (TenGigabitEthernet2/1/1) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32868 (priority 32768 sys-id-ext 100) Address a44c.11a6.7c80 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Te1/1/1 Desg FWD 2 128.53 P2p Te2/1/1 Root FWD 2 128.107 P2p

    Read the article

  • Using MVP, how to create a view from another view, linked with the same model object

    - by Dinaiz
    Background We use the Model-View-Presenter design pattern along with the abstract factory pattern and the "signal/slot" pattern in our application, to fullfill 2 main requirements Enhance testability (very lightweight GUI, every action can be simulated in unit tests) Make the "view" totally independant from the rest, so we can change the actual view implementation, without changing anything else In order to do so our code is divided in 4 layers : Core : which holds the model Presenter : which manages interactions between the view interfaces (see bellow) and the core View Interfaces : they define the signals and slots for a View, but not the implementation Views : the actual implementation of the views When the presenter creates or deals with views, it uses an abstract factory and only knows about the view interfaces. It does the signal/slot binding between views interfaces. It doesn't care about the actual implementation. In the "views" layer, we have a concrete factory which deals with implementations. The signal/slot mechanism is implemented using a custom framework built upon boost::function. Really, what we have is something like that : http://martinfowler.com/eaaDev/PassiveScreen.html Everything works fine. The problem However, there's a problem I don't know how to solve. Let's take for example a very simple drag and drop example. I have two ContainersViews (ContainerView1, ContainerView2). ContainerView1 has an ItemView1. I drag the ItemView1 from ContainerView1 to ContainerView2. ContainerView2 must create an ItemView2, of a different type, but which "points" to the same model object as ItemView1. So the ContainerView2 gets a callback called for the drop action with ItemView1 as a parameter. It calls ContainerPresenterB passing it ItemViewB In this case we are only dealing with views. In MVP-PV, views aren't supposed to know anything about the presenter nor the model, right ? How can I create the ItemView2 from the ItemView1, not knowing which model object is ItemView1 representing ? I thought about adding an "itemId" to every view, this id being the id of the core object the view represents. So in pseudo code, ContainerPresenter2 would do something like itemView2=abstractWidgetFactory.createItemView2(); this.add(itemView2,itemView1.getCoreObjectId()) I don't get too much into details. That just work. The problem I have here is that those itemIds are just like pointers. And pointers can be dangling. Imagine that by mistake, I delete itemView1, and this deletes coreObject1. The itemView2 will have a coreObjectId which represents an invalid coreObject. Isn't there a more elegant and "bulletproof" solution ? Even though I never did ObjectiveC or macOSX programming, I couldn't help but notice that our framework is very similar to Cocoa framework. How do they deal with this kind of problem ? Couldn't find more in-depth information about that on google. If someone could shed some light on this. I hope this question isn't too confusing ...

    Read the article

  • iPad: Show view as Model View

    - by a111
    hi all, i want to show my view as a model view. In iPad there are four method to show the view as modal which is listed 1. Full Screen 2. Page Sheet 3. Form sheet 4. Current Context i use following code to display the view as model -(void)OpenContactPicker { ABPeoplePickerNavigationController *ContactPicker = [[ABPeoplePickerNavigationController alloc] init]; ContactPicker.peoplePickerDelegate = self; [self presentModalViewController:ContactPicker animated:YES]; //[self.modalViewController presentModalViewController:ContactPicker animated:YES]; [ContactPicker release]; } above code open the view in full screen mode but i want to some different. Please suggest how can i show this view as Page Sheet or Form sheet or Current Context

    Read the article

  • Gson Deserialize to Java Tree

    - by MountainX
    I need to deserialize some JSON to a Java tree structure that contains TreeNodes and NodeData. TreeNodes are thin wrappers around NodeData. I'll provide the JSON and the classes below. I have looked at the usual Gson help sources, including here, but I can't seem to come up with the solution. Serialization works fine with Gson. The JSON below was produced by Gson. But deserialization is the problem I need help with. Can someone show me how to write the deserializer (or suggest an alternative approach using Gson best practices)? Here is my JSON. The "data" element corresponds to class NodeData, and the "subList" JSON element corresponds to Java class TreeNode. { "data": { "version": "032", "name": "root", "path": "/", "id": "1", "parentId": "0", "toolTipText": "rootNode" }, "subList": [ { "data": { "version": "032", "name": "level1", "labelText": "Some Label Text at Level1", "path": "/root", "id": "2", "parentId": "1", "toolTipText": "a tool tip for level1" }, "subList": [ { "data": { "version": "032", "name": "level1_1", "labelText": "Label level1_1", "path": "/root/level1", "id": "3", "parentId": "2", "toolTipText": "ToolTipText for level1_1" } }, { "data": { "version": "032", "name": "level1_2", "labelText": "Label level1_2", "path": "/root/level1", "id": "4", "parentId": "2", "toolTipText": "ToolTipText for level1_2" } } ] }, { "data": { "version": "032", "name": "level2", "path": "/root", "id": "5", "parentId": "1", "toolTipText": "ToolTipText for level2" }, "subList": [ { "data": { "version": "032", "name": "level2_1", "labelText": "Label level2_1", "path": "/root/level2", "id": "6", "parentId": "5", "toolTipText": "ToolTipText for level2_1" }, "subList": [ { "data": { "version": "032", "name": "level2_1_1", "labelText": "Label level2_1_1", "path": "/root/level2/level2_1", "id": "7", "parentId": "6", "toolTipText": "ToolTipText for level2_1_1" } } ] } ] } ] } Here are the Java classes: public class Tree { private TreeNode rootElement; private HashMap<String, TreeNode> indexById; private HashMap<String, TreeNode> indexByKey; private long nextAvailableID = 0; public Tree() { indexById = new HashMap<String, TreeNode>(); indexByKey = new HashMap<String, TreeNode>(); } public long getNextAvailableID() { return this.nextAvailableID; } ... [snip] ... } public class TreeNode { private Tree tree; private NodeData data; public List<TreeNode> subList; private HashMap<String, TreeNode> indexById; private HashMap<String, TreeNode> indexByKey; //this default ctor is used only for Gson deserialization public TreeNode() { this.tree = new Tree(); indexById = tree.getIdIndex(); indexByKey = tree.getKeyIndex(); this.makeRoot(); tree.setRootElement(this); } //makes this node the root node. Calling this obviously has side effects. public NodeData makeRoot() { NodeData rootProp = new NodeData(TreeFactory.version, "example", "rootNode"); String nextAvailableID = getNextAvailableID(); if (!nextAvailableID.equals("1")) { throw new IllegalStateException(); } rootProp.setId(nextAvailableID); rootProp.setParentId("0"); rootProp.setKeyPathOnly("/"); rootProp.setSchema(tree); this.data = rootProp; rootProp.setNode(this); indexById.put(rootProp.getId(), this); indexByKey.put(rootProp.getKeyFullName(), this); return rootProp; } ... [snip] ... } public class NodeData { protected static Tree tree; private LinkedHashMap<String, String> keyValMap; protected String version; protected String name; protected String labelText; protected String path; protected String id; protected String parentId; protected TreeNode node; protected String toolTipText;//tool tip or help string protected String imagePath;//for things like images; not persisted to properties protected static final String delimiter = "/"; //this default ctor is used only for Gson deserialization public NodeData() { this("NOT_SET", "NOT_SET", "NOT_SET"); } ... [snip] ... } Side note: The tree data structure is a bit strange, as it includes indexes. Obviously, this isn't a typical search tree. In fact, the tree is used mainly to create a hierarchical path element (String) in each NodeData element. (Example: "path": "/root/level2/level2_1".) The indexes are actually used for NodeData retrieval.

    Read the article

  • How does a BSP tree work for Z sorting?

    - by Jenko
    I'm developing a 3D engine in software, and so I must compute Z sorting manually. I'm currently using the painters algorithm to sort triangles and then drawing them back-to-front. This causes artifacts that I'm trying to correct. Would using a dynamic BSP-tree ensure "correct Z sorting" of triangles? Why? Because the bounding volumes of triangles would be similar? Since I would have a single "world" BSP tree, would I have to remove and re-add any moved/scaled/rotated object into the tree? Is it possible to add triangles into a BSP tree without the expensive cutting process? Why do you need to cut triangles on the axis planes anyway? Is it faster to traverse a BSP tree from any angle, than to sort all tris each draw like the painters algorithm?

    Read the article

  • Is there a keyboard shortcut to toggle Tree view / Places View?

    - by zinzolin
    I find both the Tree view and the Places view useful. Changing from one view to the other is not fast because one have to go into the appearance menu. It's even slower with Oneiric because this menu can now be far away. (Before Unity, I always had the tree view on and I used my bookmarks directly from the Places menu. That was fine) Is there a keyboard shortcut to toggle from one view to the other? Or is it possible to create one oneself? Thanks a lot the help !

    Read the article

  • MVP, WinForms - how to avoid bloated view, presenter and presentation model

    - by MatteS
    When implementing MVP pattern in winforms I often find bloated view interfaces with too many properties, setters and getters. An easy example with be a view with 3 buttons and 7 textboxes, all having value, enabled and visible properties exposed from the view. Adding validation results for this, and you could easily end up with an interface with 40ish properties. Using the Presentation Model, there'll be a model with the same number of properties aswell. How do you easily sync the view and the presentation model without having bloated presenter logic that pass all the values back and forth? (With that 80ish line presenter code, imagine with the presenter test that mocks the model and view will look like..160ish lines of code just to mock that transfer.) Is there any framework to handle this without resorting to winforms databinding? (you might want to use different views than a winforms view. According to some, this sync should be the presenters job..) Would you use AutoMapper? Maybe im asking the wrong questions, but it seems to me MVP easily gets bloated without some good solution here..

    Read the article

  • Getting force close when i add view to other view when a thread is running

    - by Praveena
    Hi, I am getting the below error 12-30 05:40:40.484: ERROR/AndroidRuntime(413): Uncaught handler: thread Thread-10 exiting due to uncaught exception 12-30 05:40:40.494: ERROR/AndroidRuntime(413): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. 12-30 05:40:40.494: ERROR/AndroidRuntime(413): at android.view.ViewRoot.checkThread(ViewRoot.java:2629) 12-30 05:40:40.494: ERROR/AndroidRuntime(413): at android.view.ViewRoot.requestLayout(ViewRoot.java:545) 12-30 05:40:40.494: ERROR/AndroidRuntime(413): at android.view.View.requestLayout(View.java:7657) 12-30 05:40:40.494: ERROR/AndroidRuntime(413): at android.view.View.requestLayout(View.java:7657) 12-30 05:40:40.494: ERROR/AndroidRuntime(413): at android.view.View.requestLayout(View.java:7657) 12-30 05:40:40.494: ERROR/AndroidRuntime(413): at android.view.View.requestLayout(View.java:7657) 12-30 05:40:40.494: ERROR/AndroidRuntime(413): at android.view.View.requestLayout(View.java:7657) 12-30 05:40:40.494: ERROR/AndroidRuntime(413): at android.view.ViewGroup.addView(ViewGroup.java:1749) 12-30 05:40:40.494: ERROR/AndroidRuntime(413): at android.view.ViewGroup.addView(ViewGroup.java:1708) 12-30 05:40:40.494: ERROR/AndroidRuntime(413): at android.view.ViewGroup.addView(ViewGroup.java:1688) 12-30 05:40:40.494: ERROR/AndroidRuntime(413): at com.wwwww.shout.presentationLayer.Shout$1.run(Shout.java:137) and my code is myProgressDialog = ProgressDialog.show(Shout.this,"","Loading...",true); new Thread() { public void run() { String xml; xml="<spGetUserMessages><SearchLocation></SearchLocation></spGetUserMessages>"; messages =parse.GetGetUserMessages(dataparsing.ILGetUserMessages(xml)); myProgressDialog.dismiss(); ((LinearLayout)findViewById(R.id.LinearlayoutMessage)).addView(iiii); } }.start(); at the time of adding views to the layout i am getting the above error.what is the wrong in this.Please give me some suggestions.Thanks in advance

    Read the article

  • Implement Tree/Details With Taskflow Regions Using EJB

    - by Deepak Siddappa
    This article describes on Display Tree/Details using taskflow regions.Use Case DescriptionLet us take scenario where we need to display Tree/Details, left region contains category hierarchy with items listed in a tree structure (ex:- Region-Countries-Locations-Departments in tree format) and right region contains the Employees list.In detail, Here User may drills down through categories using a tree until Employees are listed. Clicking the tree node name displays Employee list in the adjacent pane related to particular tree node. Implementation StepsThe script for creating the tables and inserting the data required for this application CreateSchema.sql Lets create a Java EE Web Application with Entities based on Regions, Countries, Locations, Departments and Employees table. Create a Stateless Session Bean and data control for the Stateless Session Bean. Add the below code to the session bean and expose the method in local/remote interface and generate a data control for that.Note:- Here in the below code "em" is a EntityManager. public List<Employees> empFilteredByTreeNode(String treeNodeType, String paramValue) { String queryString = null; try { if (treeNodeType == "null") { queryString = "select * from Employees emp ORDER BY emp.employee_id ASC"; } else if (Pattern.matches("[a-zA-Z]+[_]+[a-zA-Z]+[_]+[[0-9]+]+", treeNodeType)) { queryString = "select * from employees emp INNER JOIN departments dept\n" + "ON emp.department_id = dept.department_id JOIN locations loc\n" + "ON dept.location_id = loc.location_id JOIN countries cont\n" + "ON loc.country_id = cont.country_id JOIN regions reg\n" + "ON cont.region_id = reg.region_id and reg.region_name = '" + paramValue + "' ORDER BY emp.employee_id ASC"; } else if (treeNodeType.contains("regionsFindAll_bc_countriesList_1")) { queryString = "select * from employees emp INNER JOIN departments dept \n" + "ON emp.department_id = dept.department_id JOIN locations loc \n" + "ON dept.location_id = loc.location_id JOIN countries cont \n" + "ON loc.country_id = cont.country_id and cont.country_name = '" + paramValue + "' ORDER BY emp.employee_id ASC"; } else if (treeNodeType.contains("regionsFindAll_bc_locationsList_1")) { queryString = "select * from employees emp INNER JOIN departments dept ON emp.department_id = dept.department_id JOIN locations loc ON dept.location_id = loc.location_id and loc.city = '" + paramValue + "' ORDER BY emp.employee_id ASC"; } else if (treeNodeType.trim().contains("regionsFindAll_bc_departmentsList_1")) { queryString = "select * from Employees emp INNER JOIN Departments dept ON emp.DEPARTMENT_ID = dept.DEPARTMENT_ID and dept.DEPARTMENT_NAME = '" + paramValue + "'"; } } catch (NullPointerException e) { System.out.println(e.getMessage()); } return em.createNativeQuery(queryString, Employees.class).getResultList(); } In the ViewController project, create two ADF taskflow with page Fragments and name them as FirstTaskflow and SecondTaskflow respectively. Open FirstTaskflow,from component palette drop view(Page Fragment) name it as TreeList.jsff. Open SeconfTaskflow, from component palette drop view(Page Fragment) name it as EmpList.jsff and create two paramters in its overview parameters tab as shown in below image. Open TreeList.jsff , from data control palette drop regionsFindAll->Tree as ADF Tree. In Edit Tree Binding dialog, for Tree Level Rules select the display attributes as follows:-model.Regions - regionNamemodel.Countries - countryNamemodel.Locations - citymodel.Departments - departmentName In structure panel, click on af:Tree - t1 and select selectionListener with edit property. Create a "TreeBean" managed bean with scope as "session" as shown in below Image. Create new method as getTreeNodeSelectedValue and click ok. Open TreeBean managed bean and add the below code: private String treeNodeType; private String paramValue; public void getTreeNodeSelectedValue(SelectionEvent selectionEvent) { RichTree tree = (RichTree)selectionEvent.getSource(); RowKeySet addedSet = selectionEvent.getAddedSet(); Iterator i = addedSet.iterator(); TreeModel model = (TreeModel)tree.getValue(); model.setRowKey(i.next()); JUCtrlHierNodeBinding node = (JUCtrlHierNodeBinding)tree.getRowData(); //oracle.jbo.Row Row rw = node.getRow(); Object selectedTreeNode = node.getAttribute(0); Object treeListType = node.getBindings(); String treeNodeType = treeListType.toString(); this.setParamValue(selectedTreeNode.toString()); this.setTreeNodeType(treeNodeType); } public void setTreeNodeType(String treeNodeType) { this.treeNodeType = treeNodeType; } public String getTreeNodeType() { return treeNodeType; } public void setParamValue(String paramValue) { this.paramValue = paramValue; } public String getParamValue() { return paramValue; }<br /> Open EmpList.jsff , from data control palette drop empFilteredByTreeNode->Employees->Table as ADF Read-only Table. After selecting the  Employees result set, in Edit Action Binding dialog window pass the pageFlowScope parameters as shown in below Image. In empList.jsff page, click Binding tab and click on Create Executable binding and select Invoke action and follow as shown in below image. Edit executeEmpFiltered invoke action properties and set the Refresh to ifNeeded, So when ever the page needs the method will be executed. Create Main.jspx page with page template as Oracle Three Column Layout. Drop FirstTaskflow as Region in start facet and drop SecondTaskflow as Region in center facet, Edit task Flow Binding dialog window pass the Input Paramters as shown in below Image. Run the Main.jspx, tree will be displayed in left region and emp details will displyaed on the right region. Click on the Americas in tree node, all emp related to the Americas related will be displayed. Click on Americas->United States of America->South San Francisco->Accounting, only employee belongs to the Accounting department will be displayed.

    Read the article

  • public family tree

    - by Remus Rigo
    Hi all Does anyone know a ancestry site that allows you to create a public profile or tree, so that other visitors can see your family tree. In all sites that I have found (dynastree.com, familylink.com, ancestry.com, genebase.com), if someone wants to see your family tree, they must be members or register. thanks

    Read the article

  • Visualizing Parallel Branch and Bound Tree Exploration

    - by Akhil
    I have written a parallel program that does a depth first branch and bound exploration of a tree. I can dump the id's (id's are like this 0, 00, 01, 0000, 0001, etc.) of the nodes at frequent intervals to know the frontier of the tree that is being explored at that instant in the tree. The challenge is to visualize the tree exploration with time. Any ideas? e.g. I can draw trees(e.g. using graphViz) at different times and create a movie out of it. Looking for ideas to facilitate this visualization - some better ways to do so or easy tools that can help me make the visualization

    Read the article

  • Windows 7 Windows Explorer jumpy tree view

    - by P a u l
    Is there any way to get Windows Explorer tree view in Windows 7 to stop jumping? I think they really messed up this design. Click a node to expand a deeper level and it instantly scrolls the tree vertically to a new location. This is not a good feature since my eye completely loses the node it was focused on and I have to hunt for where I was. I want the tree view to remain fixed where it is unless I scroll it myself.

    Read the article

  • CodeIgniter/PHP - Calling a view from within a view

    - by Jack W-H
    Hi Folks Basically for my webapp I'm trying to organise it a bit better. As it at the moment, every time I want to load a page, I have to do it from my controller like so: $this->load->view('subviews/template/headerview'); $this->load->view('subviews/template/menuview'); $this->load->view('The-View-I-Want-To-Load'); $this->load->view('subviews/template/sidebar'); $this->load->view('subviews/template/footerview'); As you can tell it's not really very efficient. So I thought I'd create one 'master' view - It's called template.php. This is the contents of the template view: <?php $view = $data['view']; $this->load->view('subviews/template/headerview'); $this->load->view('subviews/template/menuview'); $this->load->view($view); $this->load->view('subviews/template/sidebar'); $this->load->view('subviews/template/footerview'); ?> And then I thought I'd be able to call it from a controller like this: $data['view'] = 'homecontent'; $this->load->view('template',$data); Unfortunately I simply cannot make this work. Does anyone have any ways around this or fixes I can put into place? I've tried putting ""s and ''s around $view in template.php but that makes no difference. The usual error is "Undefined variable: data" or "Cannot load view: $view.php" etc. Thanks folks! Jack

    Read the article

  • ASP.NET MVC View Engine Comparison

    - by McKAMEY
    EDIT: added a community wiki to begin capturing people's experience with various View Engines. Please respectfully add any experiences you've had. I've been searching on SO & Google for a breakdown of the various View Engines available for ASP.NET MVC, but haven't found much more than simple high-level descriptions of what a view engine is. I'm not necessarily looking for "best" or "fastest" but rather some real world comparisons of advantages / disadvantages of the major players (e.g. the default WebFormViewEngine, MvcContrib View Engines, etc.) for various situations. I think this would be really helpful in determining if switching from the default engine would be advantageous for a given project or development group. Has anyone encountered such a comparison?

    Read the article

  • check if a tree is complete standard ml

    - by aizen92
    I want to make a function in standard ml that checks if a tree is complete or not, the function somehow works, but its giving me the wrong type and a warning of non-exhaustive cases The tree code: datatype 'data tree = EMPTY | NODE of 'data tree * 'data * 'data tree; fun isComplete EMPTY = true | isComplete (NODE(x, y, z)) = if (x = EMPTY andalso z <> EMPTY) orelse (x <> EMPTY andalso z = EMPTY) then false else true; Now the above function's type is: ''a tree -> bool but the required type is 'a tree -> bool The warning I'm having is: stdIn:169.8 Warning: calling polyEqual stdIn:169.26 Warning: calling polyEqual stdIn:169.45-169.47 Warning: calling polyEqual stdIn:169.64-169.66 Warning: calling polyEqual stdIn:124.1-169.94 Warning: match nonexhaustive NODE (x,y,z) => ... What is the problem I'm having?

    Read the article

  • How to find largest common sub-tree in the given two binary search trees?

    - by Bhushan
    Two BSTs (Binary Search Trees) are given. How to find largest common sub-tree in the given two binary trees? EDIT 1: Here is what I have thought: Let, r1 = current node of 1st tree r2 = current node of 2nd tree There are some of the cases I think we need to consider: Case 1 : r1.data < r2.data 2 subproblems to solve: first, check r1 and r2.left second, check r1.right and r2 Case 2 : r1.data > r2.data 2 subproblems to solve: - first, check r1.left and r2 - second, check r1 and r2.right Case 3 : r1.data == r2.data Again, 2 cases to consider here: (a) current node is part of largest common BST compute common subtree size rooted at r1 and r2 (b)current node is NOT part of largest common BST 2 subproblems to solve: first, solve r1.left and r2.left second, solve r1.right and r2.right I can think of the cases we need to check, but I am not able to code it, as of now. And it is NOT a homework problem. Does it look like?

    Read the article

  • Dojo JsonRest store and dijit.Tree

    - by user1427712
    I'm having a some problem making JSonRest store and dijit.Tree with ForestModel. I've tried some combination of JsonRestStore and json data format following many tips on the web, with no success. At the end, taking example form here http://blog.respondify.se/2011/09/using-dijit-tree-with-the-new-dojo-object-store/ I've made up this simple page (I'm using dojotolkit 1.7.2) <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Tree Model Explorer</title> <script type="text/javascript"> djConfig = { parseOnLoad : true, isDebug : true, } </script> <script type="text/javascript" djConfig="parseOnLoad: true" src="lib/dojo/dojo.js"></script> <script type="text/javascript"> dojo.require("dojo.parser"); dojo.require("dijit.Tree"); dojo.require("dojo.store.JsonRest"); dojo.require("dojo.data.ObjectStore"); dojo.require("dijit.tree.ForestStoreModel"); dojo.addOnLoad(function() { var objectStore = new dojo.store.JsonRest({ target : "test.json", labelAttribute : "name", idAttribute: "id" }); var dataStore = new dojo.data.ObjectStore({ objectStore : objectStore }); var treeModel = new dijit.tree.ForestStoreModel({ store : dataStore, deferItemLoadingUntilExpand : true, rootLabel : "Subjects", query : { "id" : "*" }, childrenAttrs : [ "children" ] }); var tree = new dijit.Tree({ model : treeModel }, 'treeNode'); tree.startup(); }); </script> </head> <body> <div id="treeNode"></div> </body> </html> My rest service responds the following json { data: [ { "id": "PippoId", "name": "Pippo", "children": [] }, { "id": "PlutoId", "name": "Pluto", "children": [] }, { "id": "PaperinoId", "name": "Paperino", "children": [] } ]} I've tried also with the following response (actually my final intention n is to use lazy loading for the tree) { data: [ { "id": "PippoId", "name": "Pippo", "$ref": "author0", "children": true }, { "id": "PlutoId", "name": "Pluto", "$ref": "author1", "children": true }, { "id": "PaperinoId", "name": "Paperino", "$ref": "author2", "children": true } ]} Neither of the two works. I see no error message in firebug. I simply see the root "Subject" on the page. Thanks to anybody could help in some way.

    Read the article

  • F#: Recursive collect and filter over N-ary Tree

    - by RodYan
    This is hurting my brain! I want to recurse over a tree structure and collect all instances that match some filter into one list. Here's a sample tree structure type Tree = | Node of int * Tree list Here's a test sample tree: let test = Node((1, [Node(2, [Node(3,[]); Node(3,[])]); Node(3,[])])) Collecting and filtering over nodes with and int value of 3 should give you output like this: [Node(3,[]);Node(3,[]);Node(3,[])]

    Read the article

  • In-order tree traversal

    - by Chris S
    I have the following text from an academic course I took a while ago about in-order traversal (they also call it pancaking) of a binary tree (not BST): In-order tree traversal Draw a line around the outside of the tree. Start to the left of the root, and go around the outside of the tree, to end up to the right of the root. Stay as close to the tree as possible, but do not cross the tree. (Think of the tree — its branches and nodes — as a solid barrier.) The order of the nodes is the order in which this line passes underneath them. If you are unsure as to when you go “underneath” a node, remember that a node “to the left” always comes first. Here's the example used (slightly different tree from below) However when I do a search on google, I get a conflicting definition. For example the wikipedia example: Inorder traversal sequence: A, B, C, D, E, F, G, H, I (leftchild,rootnode,right node) But according to (my understanding of) definition #1, this should be A, B, D, C, E, F, G, I, H Can anyone clarify which definition is correct? They might be both describing different traversal methods, but happen to be using the same name. I'm having trouble believing the peer-reviewed academic text is wrong, but can't be certain.

    Read the article

  • Composite Views and View Controllers

    - by BillyK
    Hi, I'm somewhat new to Android and am in the process of designing an application with a couple fairly complex views. One of the views is intended to involve a complex view displaying information associated with model objects and segregated into several different views; the navigation of which is meant to be achieved using sliding effects (i.e. sliding one's finger across the screen to traverse from one screen to the next, etc). The view itself will be used to host multiple sets of views for varying types of model objects, but with a general structure that is reused between them all. As a rough example, the view might come up to display information about a person (the model object), displaying several details views: a view for general information, a view displaying a list of hobbies, and a view displaying a list of other individuals associated with their social network. The same general view, when given a model object representing a particular car would give several different views: A general view with details, A view containing photo images for that vehicle, a view representing locations which it could be purchased from, and a view providing a list of related cars. (NOTE: This is not the real data involved, but is representative of the general intent for the view). The subviews will NOT cover the entire screen real-estate and other features within the view should be both visible and able to be interacted with by the user. The idea here is that there is a general view structure that is reusable and which will manage a set of subviews dynamically generated based upon the type of model object handed to the view. I'm trying to determine the appropriate way to leverage the Android framework in order to best achieve this without violating the integrity of the framework. Basically, I'm trying to determine how to componentize this larger view into reusable units (i.e. general view, model-specific sub-view controllers, and individual detail views). To be more specific, I'm trying to determine if this view is best designed as a composite of several custom View classes or a composite of several Activity classes. I've seen several examples of custom composite views, but they typically are used to compose simple views without complex controllers and without attention to the general Activity lifecycle (i.e. storing and retrieving data related to the model objects, as appropriate). On the other hand, the only real example I've seen regarding a view comprised of a composite of Activities is the TabActivity itself, and that isn't customizable in the fashion that would be necessary for this. Does anyone have any suggestions as to the appropriate way to structure my view to achieve the application framework I'm looking for? Views? Activities? Something else? Any guidance would be appreciated. Thanks in advance.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >