From 7573668ef0324f4a5050be428b15e40f7fa61ac3 Mon Sep 17 00:00:00 2001 From: geronimo Date: Wed, 15 Aug 2012 19:36:18 +0200 Subject: fixed dnd for media from table, fixed editing of genre to update real genre node --- .../schwarzrot/media/domain/AbstractMediaNode.java | 31 +++++++------- cmpcj/src/de/schwarzrot/media/domain/Genre.java | 49 +++++++++++++--------- 2 files changed, 46 insertions(+), 34 deletions(-) (limited to 'cmpcj/src/de/schwarzrot/media/domain') diff --git a/cmpcj/src/de/schwarzrot/media/domain/AbstractMediaNode.java b/cmpcj/src/de/schwarzrot/media/domain/AbstractMediaNode.java index 573726c..95659aa 100644 --- a/cmpcj/src/de/schwarzrot/media/domain/AbstractMediaNode.java +++ b/cmpcj/src/de/schwarzrot/media/domain/AbstractMediaNode.java @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== * - * File: AbstractMediaNode.java - * Created: 13. June 2012, 04:57 - * Author: Geronimo - * Project: cmpc - a java frontend (client) part of compound media player - * uses external players to play the media + * File: AbstractMediaNode.java Created: 13. June 2012, 04:57 Author: Geronimo Project: cmpc - a java frontend + * (client) part of compound media player uses external players to play the + * media * * CMP - compound media player * - * is a client/server mediaplayer intended to play any media from any workstation - * without the need to export or mount shares. cmps is an easy to use backend - * with a (ready to use) HTML-interface. Additionally the backend supports - * authentication via HTTP-digest authorization. - * cmpc is a client with vdr-like osd-menues. + * is a client/server mediaplayer intended to play any media from any + * workstation without the need to export or mount shares. cmps is an easy to + * use backend with a (ready to use) HTML-interface. Additionally the backend + * supports authentication via HTTP-digest authorization. cmpc is a client with + * vdr-like osd-menues. * - * Copyright (c) 2012 Reinhard Mantey, some rights reserved! - * published under Creative Commons by-sa - * For details see http://creativecommons.org/licenses/by-sa/3.0/ + * Copyright (c) 2012 Reinhard Mantey, some rights reserved! published under + * Creative Commons by-sa For details see + * http://creativecommons.org/licenses/by-sa/3.0/ * - * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp + * The cmp project's homepage is at + * http://projects.vdr-developer.org/projects/cmp * * -------------------------------------------------------------- */ @@ -143,6 +143,7 @@ public abstract class AbstractMediaNode implements Serializable, ComparableGeronimo - * Project: cmpc - a java frontend (client) part of compound media player - * uses external players to play the media + * File: Genre.java Created: 13. June 2012, 04:57 Author: Geronimo Project: cmpc - a java frontend + * (client) part of compound media player uses external players to play the + * media * * CMP - compound media player * - * is a client/server mediaplayer intended to play any media from any workstation - * without the need to export or mount shares. cmps is an easy to use backend - * with a (ready to use) HTML-interface. Additionally the backend supports - * authentication via HTTP-digest authorization. - * cmpc is a client with vdr-like osd-menues. + * is a client/server mediaplayer intended to play any media from any + * workstation without the need to export or mount shares. cmps is an easy to + * use backend with a (ready to use) HTML-interface. Additionally the backend + * supports authentication via HTTP-digest authorization. cmpc is a client with + * vdr-like osd-menues. * - * Copyright (c) 2012 Reinhard Mantey, some rights reserved! - * published under Creative Commons by-sa - * For details see http://creativecommons.org/licenses/by-sa/3.0/ + * Copyright (c) 2012 Reinhard Mantey, some rights reserved! published under + * Creative Commons by-sa For details see + * http://creativecommons.org/licenses/by-sa/3.0/ * - * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp + * The cmp project's homepage is at + * http://projects.vdr-developer.org/projects/cmp * * -------------------------------------------------------------- */ @@ -70,6 +70,13 @@ public class Genre extends AbstractMediaNode { } + @Override + public void refresh() { + super.refresh(); + update(); + } + + public void removeGenre(Genre g) { children.remove(g); } @@ -108,12 +115,16 @@ public class Genre extends AbstractMediaNode { public void update() { // instances has moved, so all children and media members must be updated - for (Genre g : children) { - g.refresh(); - g.update(); + if (children != null) { + for (Genre g : children) { + g.refresh(); + g.update(); + } + } + if (mediaList != null) { + for (Media m : mediaList) + m.refresh(); } - for (Media m : mediaList) - m.refresh(); } private List mediaList; -- cgit v1.2.3