Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9002233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:32:33+00:00 2026-06-16T00:32:33+00:00

I need some help with Serialization of draw2d Layered Panes. I read about Serialization,

  • 0

I need some help with Serialization of draw2d Layered Panes. I read about Serialization, and found that a Class can be serialized only if it implements Serializable Interface, and all its fields are either themselves Serializable, or transient.

I have a very Complex Diagram that I need to serialize, and don’t have a clue as to how to proceed? I found out that the LayeredPane class only contains one field of type List. In any case, can any one help with how one can write, say a recursive method or something, to make a LayeredPane Object Serializable?

@mKorbel
A Sample scenario of the Problem I am facing is difficult to give, as its part of a really large application. Still, I’ve made up a case, which may give you an idea of the Problem:

public class Editor extends org.eclipse.ui.part.EditorPart {
    org.eclipse.draw2d.FreeformLayer objectsLayer;
    org.eclipse.draw2d.ConnectionLayer connectionLayer;
    public void createPartControl(Composite parent) {
        org.eclipse.draw2d.FigureCanvas canvas = new org.eclipse.draw2d.FigureCanvas(composite);

        org.eclipse.draw2d.LayeredPane pane = new org.eclipse.draw2d.LayeredPane();

        objectsLayer = new org.eclipse.draw2d.FreeformLayer();
        connectionLayer = org.eclipse.draw2d.ConnectionLayer();

        pane.add(objectsLayer);
        pane.add(connectionLayer);

        canvas.setContents(pane);

        addFigures();
        addConnections();
    }

    private void addFigures() {
        // Adds Objects, i.e.,  org.eclipse.draw2d.Figure Objects, to the objectLayer
        // which turn contains, 1 or more org.eclipse.draw2d.Panel Objects, 
        // with variable number of org.eclipse.draw2d.Label objects
    }

    private void addConnections() {
        // Adds org.eclipse.draw2d.PolylineConnection objects to the connectionLayer
        // between objects in the objectLayer
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:32:34+00:00Added an answer on June 16, 2026 at 12:32 am

    You have to extend the LayeredPane class, make it Serializable by implementing that interface and provide a method that rebuild the whole structure and properties of that LayeredPane from a model.

    public class SerializableLayeredPanne extends LayeredPanne implements Serializable {
    
        private static final long serialVersionUID = 1L;
    
        /** 
         * the model you are able to FULLY restore layered pane and all its children from,
         * it MUST be serializable 
         */
        private final Serializable model;
    
        SerializableLayeredPanne(Serializable model) {
            this.model  = model;
        }
    
        public void init() {
            // set font, color etc.
            // add children
        }
    
        private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
            in.defaultReadObject();
            init();
        }
    
    }
    

    So you have to add a Serializable model that contains all informations you need to build the figure tree from scratch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some help with Activerecord Querying in a has_many :through association. Model: Job class
Need some help assigning a mouseover event to display some icons that start out
Need some help with DataFormatString in GridView. I have a Double value that needs
Need some help, I have a regular expression that appears to work just fine
Need some help: I want to only pull back the results for a specific
Okay, I need some help here. This is the same old "can't use an
need some help! I'm trying to write some code in objective-c that requires part-of-speech
Need some help refactoring this if/else block that builds the conditions for a find
Need some help guys. For now, I can successfully get a single user timeline
I need some help about PHP GD. Here is my piece of code. header(Content-type:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.